generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: decimals

Previous Thread :: Next Thread 
LassXRagnarok is not online. LassXRagnarok
Joined: 08 Aug 2010
Total Posts: 371
20 Apr 2015 11:19 AM
how do i turn a stringvalue with value 10000 into a 10,000 value
Report Abuse
LassXRagnarok is not online. LassXRagnarok
Joined: 08 Aug 2010
Total Posts: 371
20 Apr 2015 11:25 AM
omg
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
20 Apr 2015 11:27 AM
They're not decimals... Do you mean to beautify the number into a readable form?
Report Abuse
BJCarpenter is not online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
20 Apr 2015 11:54 AM
Something like this (Will contain errors)

a = math.floor((x/1000)
strng = a..","..x-a
Report Abuse
BJCarpenter is not online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
20 Apr 2015 12:07 PM
sorry,



this (Will contain errors)

a = math.floor((x/1000)
strng = a..","..x-a*1000
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
20 Apr 2015 12:17 PM
function formatsimpleint(n)
return tostring(n):reverse():gsub('(%d%d%d)','%1,'):reverse():gsub('^,','');
end

That should work. Doesn't play nice with negatives or fractional parts but I'm not worried about that yet
Report Abuse
LassXRagnarok is not online. LassXRagnarok
Joined: 08 Aug 2010
Total Posts: 371
20 Apr 2015 12:21 PM
thx you people i was afk and yes i wanted a readable number form
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image