Given a variable between 0 and 2,000,000 how to print out with proper commas
Eg;if we input 12345 the output should be 12,345
Printable View
Given a variable between 0 and 2,000,000 how to print out with proper commas
Eg;if we input 12345 the output should be 12,345
The input should be a string. Then counting the number of spaces form the end instead of the beginning, add the commas in the places.
Or something like that.