This PR adds support for passing an additional parameter localeOptions that is used when an explicit locale is passed to allow for further customization of the output. Defaults to {}.
This is particularly useful for places where filesize is highly dynamic/animated and there is a desire to enforce a number of fixed digits, even in cases where the decimal would be zero:
Example without (notice the left-shift of the digits when no zero decimal):
This PR adds support for passing an additional parameter
localeOptions
that is used when an explicitlocale
is passed to allow for further customization of the output. Defaults to{}
.This is particularly useful for places where filesize is highly dynamic/animated and there is a desire to enforce a number of fixed digits, even in cases where the decimal would be zero:
Example without (notice the left-shift of the digits when no zero decimal):
Example with:
Usage:
The options are from ECMA-402, and are documented on MDN.