Jump to content

[SOLVED] php help web form


sethupathy

Recommended Posts

hi guys here is my new problem because i have french users that will be entering data to my web form

and there is questions with answers that require that enter data in money value 245.45 or like some users in french they use

a 245,45 (comma) i am having problem with how mysql handles the money value when there is a comma the data is after the comma is missing i am using decimal 7,2 in mysql. is there a way that the semicolon becomes a . when the data is entered by the user?

 

or is there a way around that pls any input much appreciated

Link to comment
https://forums.phpfreaks.com/topic/56646-solved-php-help-web-form/
Share on other sites

I'm kind of new in php but i will try to base this off the other programming languages i know and maybe something can spark your idea.

 

There might be a way to get the value as a string. From there, find the place value of the comma and change it into a period via string manipulation. Then use a manual function to change it from a string into a double or integer. So basically my idea would be gather the information as a string, change all comma's to periods using string manipulation, and change it into a double or integer afterward.

 

Any thoughts?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.