|
|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Member
Join Date: Aug 2001
Posts: 49
|
Dynamic Text - Can you display $ and , symbols when manipulating numbers?
I'd like to display a number like $35,000 in dynamic text, and subsequently subtract from that number. Can you do this?
|
|
|
|
|
|
#2 |
|
Junior Member
Join Date: Feb 2009
Posts: 4
|
did you figure it out? i have the same problem
|
|
|
|
|
|
#3 |
|
FK'n_Mod
Join Date: Apr 2003
Location: "aaarf"
Posts: 9,175
|
currency formatting
first - remove the "$" and "," using the string.split method
next - do the subtraction last - pass the result through a currency formatting function in this example the initial amount "$35,000" and the sum to be subtracted - 4000 - are hardcoded - str1 & num1 PHP Code:
|
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Feb 2009
Posts: 4
|
great!! thanks!!!!!!!!!!!!!!!!!!!!!!!!
so, what if i just need the part of: "pass the result through a currency formatting function" which part of the code will help me? This: var sValIntLen = sValInt.length; nTriple = Math.floor((sValIntLen-1)/3); nRemainder = ((sValIntLen-1)%3)+1; for(var count=0; count<nTriple; count++) { sResult = ","+sValInt.substr((sValIntLen-(3*(count+1))), 3)+sResult; } if(nRemainder){ sResult = sValInt.substr(0, nRemainder)+sResult; } if(nPlaces && sValDec.length){ sResult = (sResult == "") ? "0" : sResult; sResult += sValDec; } return "$"+sResult; }; ???? thank you very much i really appreciate it. ![]()
|
|
|
|
|
|
#5 |
|
FK'n_Mod
Join Date: Apr 2003
Location: "aaarf"
Posts: 9,175
|
PHP Code:
|
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Feb 2009
Posts: 4
|
thank you!!!!! i will try it
|
|
|
|
![]() |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|