954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Thousands separator in form

Hi!

I am coding a quite simple php form where many of the input forms are going to be filled with numbers. Is there a simple way I could get the numbers separated by thousands? Like the form showing 100 000 instead of 100000?

Thanks in advance!

Ingska
Newbie Poster
20 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

Do you want your output to show the numbers that way, or do you want to change after a user inputs a value and leaves the editbox. In the last case, this would be more of a javascript issue.

pritaeas
Posting Expert
Moderator
5,480 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

I would prefer if it changed after the user inputs a value ald leaves the editbox, but really any way works.

Ingska
Newbie Poster
20 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

You can start here .

pritaeas
Posting Expert
Moderator
5,480 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 
number_format("123456")
calebcook
Junior Poster in Training
66 posts since Jun 2011
Reputation Points: 10
Solved Threads: 4
 
Rhamises
Light Poster
31 posts since Aug 2011
Reputation Points: 23
Solved Threads: 5
 

Ok for you guys suggesting php, he stated:

>I would prefer if it changed after the user inputs a value ald leaves the editbox, but really any way works.

That suggests JS. I don't think he wants to submit the blasted form every time he changes the edit box contents.

diafol
Rhod Gilbert Fan (ardav)
Moderator
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
 

Thanks, guys! The solution was js, and it works great :)

Ingska
Newbie Poster
20 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: