Jump to content

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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.