I'm trying to use the example given here concerning formatting a number.
console.log((16).toLocaleString('en-GB', {
style: unit,
unit: liter,
unitDisplay: long
}));
I tried it in chrome and it works great. However, in Safari as well as Firefox I get the following errors respectively Error: style must be either decimal, percent, or currency
and Error: invalid value unit for option style
.
From the docs I figured it should work on all browsers after looking at the browser compatibility. I tried looking for answers, but I can't find anything regarding this issue. Does anyone know why this is or where I could probably find more info?