I do not have the libraries loaded, but JavaScript has some basic numeric formatting in place. use toPrecision(7)
or toFixed(4)
to obtain your desired results.
toPrecision(7)
will only show 7 digits total (truncating if necessary)
toFixed(4)
will only truncate the decimal to 4 digits.
I believe you can use formatter="formatNumber" in your column markup, and then the format function that it calls:
<sjg:gridColumn name="orderLowPrice"
title="Oder Low price"
sortable="false"
editable="true"
edittype="text"
formatter="formatNumber" />
...
<script>
function formatNumber(number){
return number.toFixed(4);
}
</script>
you can also reference here for more formatting information: https://code.google.com/p/struts2-jquery/wiki/FormatGrid