Demo showing the use of maximumFractionDigits

The numbers are rounded, as there can only be a max of one fraction digit.

by David Storey

JavaScript

var mxFr1 = new Intl.NumberFormat("en", { maximumFractionDigits: 1});

console.log(mxFr1.format(.42)); // 0.4
console.log(mxFr1.format(.99)); // 1