— js, float, toFixed — 1 min read
1123.456 - 123.4;예상(Expect)
10.056로그(Log)
10.055999999999997385??????
1(123.456 - 123.4).toFixed(3);1"0.056"좋아 됐어! 그런데? 로그가 이상하다?(Yes! But?)
1typeof (123.456 - 123.4).toFixed(3);1"string"!?!?!?
다음에 계속...(To be continue...)
리턴 값(Return value)
Number 객체를 명시하는 문자열.(A String that specifies the Number object)
1Number((123.456 - 123.4).toFixed(3));2typeof Number((123.456 - 123.4).toFixed(3));10.0562"number"