function toFix(data, val) {
var numbers = '';
for (var i = 0; i < val; i++) {
numbers += '0';
}
var s = 1 + numbers;
var spot = "." + numbers;
var value = Math.round(parseFloat(data) * s) / s;
var d = value.toString().split(".");
if (d.length == 1) {
value = value.toString() + spot;
return value;
}
if (d.length > 1) {
if (d[1].length < 2) {
value = value.toString() + "0";
}
return value;
}
}