msthac01
Thu 19 June 2008, 07:46 pm GMT +0200
Basically when I have a number that is an even thousand such as 1000 or 5000, they get displayed using the number_format as 1,000.00 or 5,000.00 for presentation, the problem is that when the user saves the values end up getting saved as 1 and 5 respectively. I know that its something wrong with the number_format function itself, but now sure how to get around this and still be able to display the values with the proper formatting. Any ideas? Thanks in advance for any help.
olaf
Fri 20 June 2008, 07:57 am GMT +0200
you need to convert the number back to 1000.00 or 1000 before you store the value in your database. use number_format only for presentation
msthac01
Wed 25 June 2008, 09:43 pm GMT +0200
the problem is that there are nearly 100 values on the page and I never know which ones may get entered as an even 1000 so I'm not sure how to check and see if the value needs to be multiplied by 1000 before saving.
olaf
Wed 25 June 2008, 10:26 pm GMT +0200
You need some fuinction to check the size of the number, check the php manual I'm sure I saw some there