@encodable/format
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "@encodable/format", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Utilities for managing time and number formats.", | ||
@@ -33,3 +33,3 @@ "sideEffects": false, | ||
"dependencies": { | ||
"@encodable/registry": "^1.0.2", | ||
"@encodable/registry": "^1.0.3", | ||
"@types/d3-format": "^1.3.1", | ||
@@ -42,3 +42,3 @@ "@types/d3-time": "^1.0.10", | ||
}, | ||
"gitHead": "76988b00f9b22c22fbe0ba660b0f4bd4438df7ed" | ||
"gitHead": "03981d54b94928eec00c47bec02930f0d7b62ad6" | ||
} |
@@ -15,29 +15,4 @@ ## @encodable/format | ||
### Example usage | ||
### Documentation | ||
```ts | ||
import { | ||
getTimeFormat, | ||
formatTime, | ||
getNumberFormat, | ||
formatNumber, | ||
getNumberFormatterRegistry, | ||
} from '@encodable/format'; | ||
// Get number format function | ||
const numFormatFn = getNumberFormat('.2f'); | ||
// Get time format function | ||
const timeFormatFn = getTimeFormat('%Y-%m-%d'); | ||
// or just format directly | ||
formatNumber('.2f', 200); // 200.00 | ||
formatTime('%Y-%m-%d', new Date()); // 2020-08-15 | ||
// can customize by adding your own formatters | ||
// or override the d3 ones | ||
getNumberFormatterRegistry().registerValue('my-format', (x) => `haha:${x}`); | ||
formatNumber('my-format', 200); // haha:200 | ||
``` | ||
[See documentation and more examples here.](https://encodable.vercel.app/encodable-format) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
86856
18
Updated@encodable/registry@^1.0.3