Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Help needed converting and showing "," i.e 1,000,000

Author
Message
DemonHill
18
Years of Service
User Offline
Joined: 20th Mar 2008
Location:
Posted: 31st May 2008 00:59
I am trying to convert a number such as 2000000 to £ 20,000,000 with the comas added i nthe right places. I know it's probably simple but after searching I can't find anything that is basic enough for me to understand. Any help would be great thx
Pixelator
18
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 31st May 2008 01:10
first what you need to do is convert it into a string and then split the string up into the appropriate sections, then on the end of each sections' new string add "," then add the strings back together. As far as i know thats the only way but somebody way better than me like latch or tdk probably know an easier way to do it.

Your signature has been erased by a mod. Reduce the size!
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 31st May 2008 09:44


TDK_Man

DemonHill
18
Years of Service
User Offline
Joined: 20th Mar 2008
Location:
Posted: 31st May 2008 10:50
TDK, Perfect many thanks

Login to post a reply

Server time is: 2026-07-05 17:13:23
Your offset time is: 2026-07-05 17:13:23