Number displays incorrectly if the first digit is zero

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
MasterLee
Party member
Posts: 141
Joined: Tue Mar 07, 2017 4:03 pm
Contact:

Re: Number displays incorrectly if the first digit is zero

Post by MasterLee »

I not blocked you working solution. I just was curious about how renaming an variable could solve the problem.
As you changing:

Code: Select all

new = tostring(text)
to

Code: Select all

new = ('%010d'):format(text)
is joust enough. For formating 10 digit numbers.
User avatar
RaycatRakittra
Prole
Posts: 22
Joined: Fri Sep 30, 2016 12:40 am
Location: Chicago, IL
Contact:

Re: Number displays incorrectly if the first digit is zero

Post by RaycatRakittra »

@zorg: I'm not ignoring you. I legitimately didn't even see you post on this whole thread until today.
And you've proved your point; yes, your code works. OP should use your code.
Sometimes, I can code things.
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Number displays incorrectly if the first digit is zero

Post by zorg »

Hallelujah! :ultrahappy:
(No but seriously, it was getting just a bit ridiculous :D)
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 3 guests