How to strip variable and add comas where needed?
Posted: Thu Nov 17, 2011 4:46 pm
I was wondering if someone could tell me how to properly strip and add comas to numbers. I currently have numbers being entered into my database without comas.
Can someone show me a good way to make sure that the info being entered in is a number and how to strip the variable leaving only numbers. Then properly adding comas where they should be. I am referring to the money system. Here are some possible results:
12,583,573
or
22,684,593.85
or
1,348.21
Not sure how to google this one. Thanks!
Can someone show me a good way to make sure that the info being entered in is a number and how to strip the variable leaving only numbers. Then properly adding comas where they should be. I am referring to the money system. Here are some possible results:
12,583,573
or
22,684,593.85
or
1,348.21
Not sure how to google this one. Thanks!