|
| 20 Apr 2015 11:19 AM |
| how do i turn a stringvalue with value 10000 into a 10,000 value |
|
|
| Report Abuse |
|
|
| |
|
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 |
|
|
|
| 20 Apr 2015 11:54 AM |
Something like this (Will contain errors)
a = math.floor((x/1000) strng = a..","..x-a |
|
|
| Report Abuse |
|
|
|
| 20 Apr 2015 12:07 PM |
sorry,
this (Will contain errors)
a = math.floor((x/1000) strng = a..","..x-a*1000 |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 20 Apr 2015 12:21 PM |
| thx you people i was afk and yes i wanted a readable number form |
|
|
| Report Abuse |
|
|