rounding problems

by Eugene Manager

JavaScript

console.log(Math.round(4.975 * 100)/100)
 console.log(Math.round(((0.235)*20)*5)/100)
/*

console.log('  '); 
for ( let i = 0; i < 2 ; i+=.01)
//let i=0.29;
{
i = Math.round(i*100)/100;
let j=((i/2)*20)*5;
let t=''+j;
let k = Math.round(j)/100;
 if(t[4] === '9')
 {
	console.log(t[4] +'-'+ k +'-'+ j); 
 }
}
*/

/*

let num = 0.145
let a = Math.round(num*100)/100
let b = a.toString().length
let c = 17-b-2
let result = Math.round(num*100 + 0.1**c)/100
console.log(result)
console.log('not - ' + a )

*/