Got this
Simba Code:Writeln('| Gained '+IntToStr(Round(XPRate))+' Experience/Hour' + PadL('|', 11) );
I want it to place commas in the correct places when the number requires it.
Got this
Simba Code:Writeln('| Gained '+IntToStr(Round(XPRate))+' Experience/Hour' + PadL('|', 11) );
I want it to place commas in the correct places when the number requires it.
Last edited by YoHoJo; 11-16-2011 at 11:00 PM.
There is another way, but can't for the life of me think of it off the top of my head.Code:Format('%4.0n', [XPRate])
Never ever approach a computer saying or even thinking "I will just do this quickly".
Whoa, what's the "'%4.0n'" about?
Simba Code:Writeln(Format('%4.0n', [9000]) )
Doesn't compile.
Error: Exception: Invalid argument index in format "" at line 4
http://villavu.com/forum/showthread.php?t=47409
For format, by the way. But that doesn't really explain what you need. I don't know if there's a function for this already, but to add commas is pretty simple. Can't explain now, but if you get the length of a string of numbers, I think you can figure it out.![]()
Simba Code:{*******************************************************************************
function GroupDigits(n: integer; token: String): String;
By: PriSoner and Nava2
Description: Formats an integer into groups of 3 seperated by `token' and
returns a formatted string (i.e 1234567 would become 1,234,567)
*******************************************************************************}
Thanks again you goodfornothin's
Use Format...but for some reason I can't pass %n which is the number format constant.
Edit: It seems you can't pass many of the format constants.... Only ones that worked for me were %d %u %x
Last edited by mormonman; 11-16-2011 at 11:48 PM.
Mormonman, file a bug report.
YoHoJo.. just use the search function, or check the docs before posting.. :/
Writing an SRL Member Application | [Updated] Pascal Scripting Statements
My GitHub
Progress Report:13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you have serious physchological problems 13:46 <@BenLand100> HE GETS IT! 13:46 <@BenLand100> HE FINALLY GETS IT!!!!1
I did both. Didn't see it anywhere.
Then I looked though MSI and found the answer.
LEME make threads if I want to, you guys are faster/smarter (normally)!
There are currently 1 users browsing this thread. (0 members and 1 guests)