Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

JS Math.round() - Round number to the nearest integer

0 votes
26 views
added Jul 10 in Javascript by LC Marshal Lieutenant (13,570 points)
edited Jul 13 by LC Marshal
//The Math.round() function returns the value of a number rounded to the nearest integer.
console.log('5 year with/out dividend = ' + Math.round(annual * 5 + e5) + '|' + Math.round(annual * 5)); 
//e.g output 550328.99765 to 550328

1 Response

0 votes
responded Jul 13 by LC Marshal Lieutenant (13,570 points)
edited Jul 13 by LC Marshal
console.log('Year 10 gross/loan = ' + (Math.round((l10 - case200) + case200)).toLocaleString() + s + '-' + (Math.round(annual * y10)).toLocaleString());

console.log('Year 5 gross/loan = ' + (Math.round(annual * y5 + e5)).toLocaleString() + s + noloan); 

console.log('Year 15 gross/loan = ' + (Math.round((k15 - case100) + case100)).toLocaleString() + s + loan10);

console.log('Year 5 gross/loan = ' + (Math.round((kf5 - case50) + case50)).toLocaleString() + s + '-' + (Math.round(kuwait50Annual * y5)).toLocaleString()); 

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...