How can I Round up numbers in this conversion table
I am using this code to convert liquid volume but it converts too many decimal places. Could someone show me how to reduce the conversion to 1 or 2 decimal places?
Many thanks
// JavaScript Document
<!--
function nofocus()
{
document.convert.InUnit.focus()
}
var mlValue = 1
var ltrValue = 1000
var fozValue = 28.4
var cupValue = 236
var ptValue = 568.261
function toCM()
{
var i = document.convert.unit.selectedIndex
var thisUnit = document.convert.unit.options[i].value
if (thisUnit == "ML")
{
document.convert.ml.value = document.convert.InUnit.value
}
toAll()
}
function toAll()
{
var m = document.convert.ml.value
document.convert.ltr.value = m / ltrValue
document.convert.foz.value = m / fozValue
document.convert.pt.value = m / ptValue
document.convert.cup.value = m / cupValue
}