stringify @localizer/format 1.1.1
Converts any value into a locale-independent Localizable
using string coercion. Suitable for simple string representations.
WARNING
Only use stringify
for simple string representations. For other data types, use specialized formatters.
Usage
typescript
import { stringify } from '@localizer/format';
const result = stringify({});
Demo
Input value | Localized value |
---|---|
"Hello, world!" | Hello, world! |
undefined | undefined |
null | null |
true | true |
42 | 42 |
Math.PI | 3.141592653589793 |
Infinity | Infinity |
-Infinity | -Infinity |
NaN | NaN |
[1, 2, 3] | 1,2,3 |
{ a: 1, b: 2 } | [object Object] |
/abc/ | /abc/ |
function() {} | function() { } |
new Date(2025, 5, 1) | Sun Jun 01 2025 00:00:00 GMT+0000 (Coordinated Universal Time) |