The value is calculated incorrectly
Reported by
aleksey....@outlook.com,
Oct 29
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 Steps to reproduce the problem: 1. 2/7 => 0.2857142857142857 2. (2/7).toFixed(2) = > "0.29" 3. parseFloat((2/7).toFixed(2)) => 0.29 4. parseFloat((2/7).toFixed(2))*100 => 28.999999999999996 What is the expected behavior? parseFloat((2/7).toFixed(2))*100 => 29 What went wrong? parseFloat((2/7).toFixed(2))*100 => 28.999999999999996 Did this work before? N/A Chrome version: 70.0.3538.77 Channel: stable OS Version: 10.0 Flash Version: In IE works correctly
,
Oct 29
,
Oct 30
aleksey.grigorev@ Thanks for the issue. Able to reproduce the issue on Windows 10, Mac OS 10.13.6 and Ubuntu 17.10 on the latest Stable 70.0.3538.77 and the latest Canary 72.0.3596.0. Attached is the screen shot for reference. This is a Non-Regression issue as this is observed from M-60 chrome builds. Hence marking this as Untriaged for further updates from Dev. Thanks..
,
Nov 1
Agree with the explanation in #1 - this is how floating point math works. |
||||
►
Sign in to add a comment |
||||
Comment 1 by woxxom@gmail.com
, Oct 29