开发者

transpose number to USD

开发者 https://www.devze.com 2023-03-16 12:43 出处:网络
I have onclick=\"document.getElementById(\'field1\').value = (Math.round((parseFloat(document.getElementById(\'field2\').value,2)*100))/100 +

I have

onclick="document.getElementById('field1').value = 
(Math.round((parseFloat(document.getElementById('field2').value,2)*100))/100 + 
Math.round((parseFloat(document.ge开发者_JAVA技巧tElementById('field3').value,2)*100))/100).toFixed(2);" 

Field 2 and 3 are text input (numeric values). How can I transpose the value of field 1 to a currency value. Example

onclick="document.getElementById('field1').value = parseInt(document.getElementById('200.75').value) * parseInt(document.getElementById('11').value);"

and have field1 return $2,208.25

0

精彩评论

暂无评论...
验证码 换一张
取 消