as question!
- Started
- Last post
- 70 Responses
- ********0
- ********0
bump
- joyride0
I see it, just thinking,it's dropping the 2 digits when say hundreds are 100
- ********0
yes
- ********0
i split the text field in 3 parts so i can separate it visually better in the end..
--this is the code:
count_s = Math.round(_root.large_arrow._ro... *100000);
millions = Math.floor(count_s/1000000);
thous = Math.floor((count_s-(millions*10...
hundreds = count_s-((millions*1000000)+(tho..._root.count_sub.count_subsidie1... = millions;
_root.count_sub.count_subsidie2... = thous;
_root.count_sub.count_subsidie3... = hundreds;---
this is the swf
http://vormburo.nl/nt/test/barom…so what to do about the zero's??
- joyride0
well, it might be ugly but it might work, let me test for a minute.
- grunttt0
32 Male
- joyride0
ok, this is for the hundreds:
if (hundreds. toString().length==1) {
var newHundreds:String = hundreds. toString().concat("", "00");
trace(newHundreds);
hundreds = newHundreds
}else if (hundreds.toString().length==2){
var newHundreds:String = hundreds.toString().concat("", "0");
trace(newHundreds);
hundreds = newHundreds
}kinda ghetto but it gets the 00 in and the 0 in case its .02 you might need to do it for the thousands too
- joyride0
LOL
put that right after the hundreds and before the mystring =
- ********0
i don't have mytstring anylonger. it changed. see my last post.
- ********0
what i don't get, if you check my swf, is that in this case the number for testing ends with 400, but then it DOES display the zero's..
driving me nuts! haaarr......
- ********0
oh just tried with 15 000 000
and it shows up as 15 0 0
- joyride0
is fine without mystring. just put it after the hundreds =
yeah, it looks for the length of hundreds... so if its just 4 it adds the 00 at the end and same for 40 it will add the 0
- ********0
ok willl try..
- joyride0
use the same code for thous. but change the hundreds to thous and the newHundreds to newThous...
That should work fine... at least in all my tests is did. even the 15 000 000
came out 15.000.000
- ********0
nice that seems to work!!
i did the same for thous.
and what should i do if i want the millions to do the same? but only opposite, ie. if it's 1 million it should show up as 01 000 000 instead of
1 000 000so jsut for the first two numbers in this case?
- joyride0
hrmm... i'll see what I can do about mill
- ********0
nice! :)
- joyride0
do you want 001 and 01 for millions?
I'll just post the 01 unless you say so...
- joyride0
if (millions.toString().length == 1) {
var myMillions:String = "0";
var newmillions:String = myMillions.concat("", millions);
millions = newmillions;
}put right after the first millions =
Oh and I need an address to send a bill... lol