This error pops up since the value of the field you are trying to set has more than two decimal values. Please use the following function below to limit the no of digits after the decimal point.
eg : a = 5.1233456
result = a.toFixed(2);
result = 5.12
Similarly one can limit the number of digits after decimal point as desired.