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: Comma Problem?

Previous Thread :: Next Thread 
Mr_Clockwork is not online. Mr_Clockwork
Joined: 25 Feb 2016
Total Posts: 897
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
Mr_Clockwork is not online. Mr_Clockwork
Joined: 25 Feb 2016
Total Posts: 897
14 May 2016 04:34 PM
rip
Report Abuse
Mr_Clockwork is not online. Mr_Clockwork
Joined: 25 Feb 2016
Total Posts: 897
14 May 2016 04:44 PM
bump
Report Abuse
Mr_Clockwork is not online. Mr_Clockwork
Joined: 25 Feb 2016
Total Posts: 897
14 May 2016 04:54 PM
is it that hard to fix
Report Abuse
Jammer622 is not online. 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
Mr_Clockwork is not online. Mr_Clockwork
Joined: 25 Feb 2016
Total Posts: 897
14 May 2016 05:06 PM
nope, still didnt do it
Report Abuse
Jammer622 is not online. 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
Mr_Clockwork is not online. Mr_Clockwork
Joined: 25 Feb 2016
Total Posts: 897
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 is not online. 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
xThe_Developer is not online. xThe_Developer
Joined: 07 Aug 2013
Total Posts: 585
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 is not online. 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
xThe_Developer is not online. xThe_Developer
Joined: 07 Aug 2013
Total Posts: 585
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
Mr_Clockwork is not online. Mr_Clockwork
Joined: 25 Feb 2016
Total Posts: 897
15 May 2016 07:39 AM
nope it still says 5000,000 for me instead of 5,000,000 ):
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