CalcBuilder Forum

comma formatting

User anonymous 2011-10-18 21:45:29

Hello,

You can write me how to change that by introducing the data you could use a comma?



When you enter a data from a comma, eg 5,40 * 5,30 the result is different than when I enter 5.40 * 5.30.

In my commonly used commas.

Moonsoft support 2011-10-18 21:45:52

Hello,
if your users introduce commas when writting numbers, you should format the numbers before starting math to provide correct numbers to php functions. We suggest starting using
str_replace

function to replace all commas introduced at input for dots.

Then you could make all calculations.

And you could show results formatted as your users expect to see the numbers using number_format to specify thousand and decimal separators.


Hope this helps

...
List Manager

Build different lists for your site

Buy now!
...
Support/development 40 hours

With the peace of mind of having a professional team at your service (20% discount)

Buy now!