0.7.1 • Published 4 years ago

@jurijtokarski/format v0.7.1

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Formatting helpers

Install

npm i @jurijtokarski/format or yarn add @jurijtokarski/format.

formatPrice

formatPrice(100.0981923876, "PLN"); // 100,10 zł (third param set based on browser locale)
formatPrice(100.0981923876, "USD"); // 100,10 USD (third param set based on browser locale)
formatPrice(100.0981923876, "USD", "en"); // $100.10
formatPrice(100.0981923876, "PLN", "uk"); // 100,10 PLN
formatPrice(100.0981923876, "PLN", "en"); // PLN 100.10

formatPrice

capitalize("hello"); // Hello
capitalize("hELLO"); // Hello
capitalize("hEllO"); // Hello
capitalize("HELLO"); // Hello

Definitions

Feel free to check TypeScript's definitions for the package.