Your sample code includes the wrong separators though. The Format function takes the U.S. characters and will output a result that matches the localization of the system it’s being run on.
please note that postgres has a money field type that is made for this.
then you can use the currency data type in xojo.
be aware that there is a bug (?) you cannot use rs.field("fuelam").currencyvalue often gives you a zero
(at least on my french system may be it works on a US system ?)
I made a method toCurrency that converts a string into a currency data type
and I use rs.field("fuelam").stringvalue.toCurrency to get my value.
Currency.ToText information doesn’t say that will use the locale settings (even when it is expected), a little test on a system with decimal character (,) instead of (.) and this code:
Dim m As Currency = 0.5
lb1.Text = m.ToText
lb2.Text = Format(m, "#,##0.00")
Will result in:
0.5
0,50
At least on my computer.
Note: my system usually use . as decimal separator, I changed that on setting for the test.