Its not really a bug, its more like retarded.
If you use format number, than it will give for example: 321,213.00 (with GB local atleast)
And why it is retarded? Because you can only give integer value to format number, so you probably you dont want that two 0 at the end!
Also I cant find any good way to make "," between every 3rd and 4th number.
Can somebody post this on NA forum? It would be simple to fix it for them.
And I dont want to pull substrings from my integer number and put , between them.
for example if you are gonna use a decimal in a text out put such as ..... 1,333.12345 and you only want to display up to the hudredths position you do
Text Message covert real to text(RealNumber, 2) it asks you how many decimals to display.
you could do something like this
TestVal = 111,222,333,444.555 (this is a real value)
TempString = Friendly_number_Function (TestVal)
Friendly_number_Function (TempReal) Return as string
Integers ( im not really sure what the upper limit of integers are in SC2)
TempBillions
TempMillions
TempThousands
TempHundreds
TempDecimals
TempNumString
TempBillions = TempReal / 1,000,000,000
TempReal = TempReal - TempBillions
TempMillions = TempReal / 1,000,000
TempReal = TempReal - TempMillions
TempThousands = TempReal / 1,000
TempReal = TempReal - TempThousands
TempHundreds = TempReal / 1
TempReal = TempReal - TempHundreads
TempDecimals = TempReal * 100 (100 will get you 2 decimals 1000 would get you 3 and so on)
Theres a bit more logic involved in formatting all these values into a string you want... im at work and the time to type it out correctly would take too much atm... maybe somebody could assist...
the hardest part is getting "0's" in where they need to go for like "1,021" you almost need a subroutine to do this..... I do belive galaxy has a "string length" function so you should be able to just add zeros
if you really dont understand where im going with this then you can pm me and Ill try and get you a working version
I wont use format numbers as ain't working like it said. But it would be good thing.
And I do want to use integer values. (max integer is about 2.2 billion)
I am not really sure what you want to do there. But I think its easier to format the number with using substring command based on string length.
But as I want to use this frequently on my map, it would be nicer to have format number working correctly.
Do-it-yourself-kit:
local string var formatedString=""
local string origin=Int2String(mynumber)
local int length=StringLength(origin)
local int offset=0
while length-(offset+1)*3 >0 do:
formatedString= "," + Substring(origin,(length-(offset+1)*3) +1, length - offset*3) + formatedString
offset +=1
endwhile
if StringLength(formatedString) -offset != length then do:
formatedString=SubString(origin,1,length-offset*3) + formatedString
endif
Make a trigger out of this.
Edit: Tested and confirmed. Just don't forget to set a "-" instead of "+" in the while condition else your starcraft will stop working since we created a nice little infinite loop :D
This will format strings like 92434612 to 92,434,612
I dont know what did blizzard do but its now even worse than before. Its now sometimes showing .00 after number and sometimes not. (I wasted half hour cause I thought they actually fixed that)
I dont know what did blizzard do but its now even worse than before. Its now sometimes showing .00 after number and sometimes not. (I wasted half hour cause I thought they actually fixed that)
Indeed. I had same situation. I ran my map and suddenly it was all with .00000
2.0.4 fixed this issue.
Its not really a bug, its more like retarded.
If you use format number, than it will give for example: 321,213.00 (with GB local atleast)
And why it is retarded? Because you can only give integer value to format number, so you probably you dont want that two 0 at the end!
Also I cant find any good way to make "," between every 3rd and 4th number.
Can somebody post this on NA forum? It would be simple to fix it for them.
And I dont want to pull substrings from my integer number and put , between them.
@Hookah604: Go
for what reason are you using "format number"?
for example if you are gonna use a decimal in a text out put such as ..... 1,333.12345 and you only want to display up to the hudredths position you do
Text Message covert real to text(RealNumber, 2) it asks you how many decimals to display.
you could do something like this
TestVal = 111,222,333,444.555 (this is a real value) TempString = Friendly_number_Function (TestVal)
Friendly_number_Function (TempReal) Return as string
Theres a bit more logic involved in formatting all these values into a string you want... im at work and the time to type it out correctly would take too much atm... maybe somebody could assist... the hardest part is getting "0's" in where they need to go for like "1,021" you almost need a subroutine to do this..... I do belive galaxy has a "string length" function so you should be able to just add zeros
if you really dont understand where im going with this then you can pm me and Ill try and get you a working version
I wont use format numbers as ain't working like it said. But it would be good thing.
And I do want to use integer values. (max integer is about 2.2 billion)
I am not really sure what you want to do there. But I think its easier to format the number with using substring command based on string length.
But as I want to use this frequently on my map, it would be nicer to have format number working correctly.
Do-it-yourself-kit:
local string var formatedString=""
local string origin=Int2String(mynumber)
local int length=StringLength(origin)
local int offset=0
while length-(offset+1)*3 >0 do:
formatedString= "," + Substring(origin,(length-(offset+1)*3) +1, length - offset*3) + formatedString
offset +=1
endwhile
if StringLength(formatedString) -offset != length then do:
formatedString=SubString(origin,1,length-offset*3) + formatedString
endif
Make a trigger out of this.
Edit: Tested and confirmed. Just don't forget to set a "-" instead of "+" in the while condition else your starcraft will stop working since we created a nice little infinite loop :D
This will format strings like 92434612 to 92,434,612
I am not sure if it worth to run trigger like that for my map just for , marks every second for each player 4 times with max 14 player.
If you fear lags then you should better not worry about triggers like that but about too much eye candy, units and stuff like that ;)
I dont know what did blizzard do but its now even worse than before. Its now sometimes showing .00 after number and sometimes not. (I wasted half hour cause I thought they actually fixed that)
Indeed. I had same situation. I ran my map and suddenly it was all with .00000
Seems like they finally fixed this shit in 1.5!
fuck this shit, its still not working.