formatNumber helper explicitly verifies the type of a value and throws an exception if it's other than number. But Internationalization API Specification doesn't put such a restriction and Intl.NumberFormat().format() function accepts the argument of any type. So the following examples are perfectly legitimate:
formatNumber
helper explicitly verifies the type of a value and throws an exception if it's other thannumber
. But Internationalization API Specification doesn't put such a restriction andIntl.NumberFormat().format()
function accepts the argument of any type. So the following examples are perfectly legitimate:I would also expect from this helper to accept a value of any type.
Thank you.