crazyswede Posted December 20, 2011 Share Posted December 20, 2011 Balances = new Number(0); <-- here I establish my number objectBalances.balance = Number(0);Balances.ColumbiaBeginBalance = Number(0);Balances.ColumbiaEndBalance = Number(0);Balances.boaBeginBalance = Number( 0);Balances.boaEndBalance = Number(0);-------------------------------------------------------------xxx=123.123456iii=xxx.toFixed(2); <--- this works when I type a literal number******************Balances.balance = 123.123456;<-- this works, too, but I can't have 'Balances.balance' be the same number all the time.xxx= Balances.balance;iii=xxx.toFixed(2); ******************---------- this is how I need it -------------------xxx= Balances.balance;<-- when I use a variable, it doesn't workiii=xxx.toFixed(2); Microsoft JScript runtime error '800a01b6' Object doesn't support this property or method /books/cfpCheckBook2.asp, line 271 ******************---------- would this be a possible option?: Doesn't work, either. iii= Balances.balance.toFixed(2); Link to comment Share on other sites More sharing options...
ShadowMage Posted December 20, 2011 Share Posted December 20, 2011 Your use of Number() is really unnecessary, first of all. Just saying x=5 creates a Number object. Secondly, you are adding properties to the Number object. I would create a separate Balances object. Ie, var Balances = { balance: 0, ColumbiaBeginBalance: 0, ColumbiaEndBalance: 0, boaBeginBalance: 0, boaEndBalance: 0} Link to comment Share on other sites More sharing options...
davej Posted December 21, 2011 Share Posted December 21, 2011 [...]xxx= Balances.balance;<-- when I use a variable, it doesn't workiii=xxx.toFixed(2); Have you tried this? iii = Number(Balances.balance).toFixed(2); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.