Dot and comma

Questions, tips and tricks and techniques for scripting in Servoy

Dot and comma

Postby studiomiazzo » Wed Jul 18, 2012 4:08 pm

Say that my decimal separator is comma.
Is there a way to make dot would be treated like comma?
I would like that users could entry indistinctly dot or comma to separate decimal from integer part.
User avatar
studiomiazzo
 
Posts: 124
Joined: Thu Jun 16, 2011 10:48 am
Location: Novara (IT)

Re: Dot and comma

Postby omar » Wed Jul 18, 2012 4:46 pm

Hi,

For the text fields that show prices, amounts, currencies etc. fill in the format property. For example like this:

Code: Select all
¤ ###,###.00


This is a standard formatting mask that you can fill for displaying and/or editing.

In the application the user can choose his/her locale in the preferences menu and the price or amount will be shown accordingly (€ 18,00 for european users and $ 18.00 for americans). Note that the amounts are not converted when you choose a different locale but that's kind of obvious. Also restart the application after changing the locale.

Kind regards,
Intrasoft, Founder
Omar van Galen
omar@intrasoft.nl
+31-(0)6-21234586
Servoy Developer
omar
 
Posts: 377
Joined: Sat Feb 12, 2011 4:51 pm
Location: Intrasoft, The Netherlands

Re: Dot and comma

Postby studiomiazzo » Wed Jul 18, 2012 5:37 pm

I'm already using the format mask 0,00|0,00.
The fact is that when a user enter for example 6,50 all is ok (the value is 6,50) but if a user enter 6.50 the value is 6.
My purpose is to parify in some manner dot and comma so that the user could enter value without the need to distinct dot and comma.
User avatar
studiomiazzo
 
Posts: 124
Joined: Thu Jun 16, 2011 10:48 am
Location: Novara (IT)


Return to Methods

Who is online

Users browsing this forum: No registered users and 6 guests

cron