ZingGrid: Truncating Decimals In Columns

You can use the number  column type to ensure the column renders as a number. 

<zg-column index="" type="number"></zg-column>

If you want to format the number you can do that in your database/datastore OR you could use renderer  function on the column to do this in JavaScript. The renderer function is the original value passed into a function.

<zg-column index="" type="number" renderer="truncateDecimals"></zg-column>

Where the function looks like this:

function truncateDecimals(importance, cellRef, domRef) {
  return importance.toFixed(2);
}

Not Implemented Yet:
In the future this may update to an attribute like type-number-decimals and you specify the precision. 

<zg-column>

This doc may be out of date and you can reach support@zingsoft.com for more details!

Related Documentation

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us