Currency Display on Web

Greetings,

Any idea how to display properly the locales on Web text field and as well to format them on input ?

So the Decimal for me is . and the separator is ,

If i set the field as Double and i put the amount as 15000,00 i will get on display 15.00000 if i set the numbers as 15,000.00 i get as well 15 only

So what is the proper way to store prices in the DB and to properly retrieve them and show them on the web interface?

i need them to input like #,###.## format

I tried as Currency, as double and nothing. I even tried this example : http://developer.xojo.com/double$Equals

Dim n As Double = 1239.4567 Dim t As Text = n.ToText(Locale.Current, "#,###.##") ' t = 1,239.46

But no luck

Thanks.

Locale current is the server locale.
You should use the user locale that you can read from Session.Header(“Accept-Language”)

Then you can write to the user the number in the right way
On reading from a text input you can use the same strategy (double.fromText) but keep in mind that sometimes users write numbers in the “english” way so be careful to use try/catch

Session.LanguageCode or Session.Header(“Accept-Language”) will help you determine what to display based on the user’s browser settings.

More information and examples here: http://developer.xojo.com/localization$localizing-web-apps