Decimal Places


hi seems simple question cannot figure out, , dont see why isnt working is.

i have base price want show in textfield, shows without last 2 decimal places.

i have tried ".tofixed(2)" , "math.round(baseprice*100)/100" still showing 20.

 

[as]

//======================base price========================================

var baseprice:number;

baseprice = 20.00;

baseprice.tofixed(2)

 

 

priceoutput.text = string(baseprice)

 

[/as]

 

any appericated, thanks.

make sure textfield wide enough display text.



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support