Code: Select all
function round2(number) {
return Math.round(number * 100) / 100;
}Code: Select all
function round2str(number) {
// Force two decimals only:
return round2(number).toString().replace(/(\...).*/, '$1');
}Thanks,
Mardonis
Code: Select all
function round2(number) {
return Math.round(number * 100) / 100;
}Code: Select all
function round2str(number) {
// Force two decimals only:
return round2(number).toString().replace(/(\...).*/, '$1');
}