Merge pull request #4196 from neilLasrado/develop
Fixed issue in Item Variant for Numeric Attributes
diff --git a/erpnext/controllers/item_variant.py b/erpnext/controllers/item_variant.py
index 38536cf..0e1d126 100644
--- a/erpnext/controllers/item_variant.py
+++ b/erpnext/controllers/item_variant.py
@@ -51,7 +51,7 @@
frappe.throw(_("Increment for Attribute {0} cannot be 0").format(attribute))
is_in_range = from_range <= flt(value) <= to_range
- precision = len(cstr(increment).split(".")[-1].rstrip("0"))
+ precision = max(len(cstr(v).split(".")[-1].rstrip("0")) for v in (value, increment))
#avoid precision error by rounding the remainder
remainder = flt((flt(value) - from_range) % increment, precision)