Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var total = 10.90;
- totalreal = parseInt(total)
- totalrealF = parseFloat(total)
- totalrealN = Number(total)
- document.write(
- 'R$ ' + totalreal + '<br>' +
- 'R$ ' + totalrealF + '<br>' +
- 'R$ ' + totalrealN + '<br>' +
- 'R$ ' + total + '<br>'
- );
- R$ 10
- R$ 10.9
- R$ 10.9
- R$ 10.9
- R$ 10.90
- var total = 10.90;
- totalrealF = parseFloat(total).toPrecision(4)
- console.log(totalrealF)
Add Comment
Please, Sign In to add comment