partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 4922a0bdb59675b2fd371f84877db3dc48733a5b
parent ed5498ec3a0cb108c9ff5ae9147bfbaa1cc8ff0f
Author: Felicia Hummel <felicia@drachenkatze.org>
Date:   Fri,  6 Jul 2018 16:45:20 +0200

Removed improper rounding; might not be the final fix.

Example: In the database, we got a 10µF part, which equals to a normalized value of 0.00001. However, with IEEE 754, the number is represented as 0.000009999999999999999 instead of 0.00001. A fixed rounding of course makes no sense

Diffstat:
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsGrid.js | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsGrid.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsGrid.js @@ -407,7 +407,7 @@ Ext.define('PartKeepr.PartsGrid', { applySiPrefix: function (value, siPrefix) { if (siPrefix instanceof PartKeepr.SiPrefixBundle.Entity.SiPrefix) { - return Ext.util.Format.round(value * Math.pow(siPrefix.get("base"), siPrefix.get("exponent")), 3); + return value * Math.pow(siPrefix.get("base"), siPrefix.get("exponent")); } else { return value; }