Hello all,
I am new to Vala and I am struggling with how to format a float value to a currency/monetary format.
I have tried the following:
public string format_to_monetary_form(float value, string currency) {
Intl.setlocale (LocaleCategory.NUMERIC, "");
string pattern = "%'.2f %s";
return pattern.printf(value, currency);
}
calling the function format_to_monetary_form(10000, "USD"), I expect the following:
10,000 USD
but I get the following instead:
10000 USD
Please kindly assist.
Thanks.
Environment:
Windows 10 (Msys2-MINGW64)