|
| 14 May 2016 04:18 PM |
Why dosent it add a second comma for the million?
elseif tonumber(Cash.Value) > 999999 then local Start = Cash.Value:sub(1, Cash.Value:len() - 3) local Mid = Cash.Value:sub(1, Cash.Value:len() - 3) local End = Cash.Value:sub(Start:len()+1, Cash.Value:len()) script.Parent.Text = Start..","..Mid..","..End end |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
Jammer622
|
  |
| Joined: 19 Nov 2008 |
| Total Posts: 1739 |
|
|
| 14 May 2016 05:01 PM |
yowza
Because Start and Mid begin at the same place, perhaps?
local Start = Cash.Value:sub(1, Cash.Value:len() - 6) local Mid = Cash.Value:sub(Start:len() + 1, Cash.Value:len() - 3) local End = Cash.Value:sub(Cash.Value:len() - 2)
i threw numbers into spots try that |
|
|
| Report Abuse |
|
|
| |
|
Jammer622
|
  |
| Joined: 19 Nov 2008 |
| Total Posts: 1739 |
|
|
| 14 May 2016 05:19 PM |
seemed to work for me
Cash = "5000000" local Start = Cash:sub(1, Cash:len() - 6) local Mid = Cash:sub(Start:len() + 1, Cash:len() - 3) local End = Cash:sub(Cash:len() - 2) print(Start..","..Mid..","..End)
> 5,000,000 |
|
|
| Report Abuse |
|
|
|
| 14 May 2016 06:25 PM |
Shows this https://gyazo.com/944fdb627f0b50ed192cc394bf44b395
This is my code
Cash.Changed:connect(function() if tonumber(Cash.Value) > 999 then local Start = Cash.Value:sub(1, Cash.Value:len() - 3) local End = Cash.Value:sub(Start:len()+1, Cash.Value:len()) script.Parent.Text = Start..","..End .. " ROBUX" elseif tonumber(Cash.Value) > 999999 then local Start = Cash:sub(1, Cash:len() - 6) local Mid = Cash:sub(Start:len() + 1, Cash:len() - 3) local End = Cash:sub(Cash:len() - 2) script.Parent.Text = Start..","..Mid..","..End .. " ROBUX" end end) |
|
|
| Report Abuse |
|
|
Jammer622
|
  |
| Joined: 19 Nov 2008 |
| Total Posts: 1739 |
|
|
| 14 May 2016 06:27 PM |
i totally forgot i was still working on this hold on |
|
|
| Report Abuse |
|
|
|
| 14 May 2016 06:27 PM |
You might want to check if the number of characters are dividable by 3, then if its not subtract one or two depending on the number of characters
#code mod = require(sike) if not mod.xThe[...] then print("You're not RbxDev yet..") end |
|
|
| Report Abuse |
|
|
Jammer622
|
  |
| Joined: 19 Nov 2008 |
| Total Posts: 1739 |
|
|
| 14 May 2016 06:31 PM |
wait a second
I took off the .Values from Cash because I was using print to debug it
Cash.Changed:connect(function() if tonumber(Cash.Value) > 999 then local Start = Cash.Value:sub(1, Cash.Value:len() - 3) local End = Cash.Value:sub(Start:len()+1, Cash.Value:len()) script.Parent.Text = Start..","..End .. " ROBUX" elseif tonumber(Cash.Value) > 999999 then local Start = Cash.Value:sub(1, Cash.Value:len() - 6) local Mid = Cash.Value:sub(Start:len() + 1, Cash.Value:len() - 3) local End = Cash.Value:sub(Cash:len() - 2) script.Parent.Text = Start..","..Mid..","..End .. " ROBUX" end end) |
|
|
| Report Abuse |
|
|
|
| 14 May 2016 07:01 PM |
Or convert it to scientific notation and classify it like tha
#code mod = require(sike) if not mod.xThe[...] then print("You're not RbxDev yet..") end |
|
|
| Report Abuse |
|
|
|
| 15 May 2016 07:39 AM |
| nope it still says 5000,000 for me instead of 5,000,000 ): |
|
|
| Report Abuse |
|
|