��---
=��� Price Formatter
Format price numbers with currency symbols effortlessly. Ensure consistent and clear price display in your JavaScript applications.
=��� Installation
Install via npm:
npm install price-formatter
=� Usage
const formatPrice = require('price-formatter');
const price = formatPrice('
=���� Functionality
formatPrice(symbol: string, price: number): string
- symbol: Currency symbol (e.g.,
$, � , � )
- price: Number to format
=�� Returns:
- If
price is 0 or not a number �! "symbol 0"
- If
price is negative �! "-symbol number"
- If
price is positive �! "symbol number"
=ء� Examples
formatPrice('
>�� Contributing
Fork the repo
Clone your fork
git clone https://github.com/your-username/price-formatter.git
Create a branch
git checkout -b feature/YourFeature
Make your changes
Commit
git commit -m "Add some feature"
Push & PR
git push origin feature/YourFeature
Open a Pull Request from your forked branch on GitHub.
=��� License
Licensed under the ISC License. See the LICENSE file for details.
, 100);
// => "$ 100"
=���� Functionality
__CODE_BLOCK_2__
- symbol: Currency symbol (e.g., __INLINE_CODE_0__, __INLINE_CODE_1__, __INLINE_CODE_2__)
- price: Number to format
=�� Returns:
- If __INLINE_CODE_3__ is 0 or not a number �! __INLINE_CODE_4__
- If __INLINE_CODE_5__ is negative �! __INLINE_CODE_6__
- If __INLINE_CODE_7__ is positive �! __INLINE_CODE_8__
=ء� Examples
__CODE_BLOCK_3__
>�� Contributing
Fork the repo
Clone your fork
__CODE_BLOCK_4__
Create a branch
__CODE_BLOCK_5__
Make your changes
Commit
__CODE_BLOCK_6__
Push & PR
__CODE_BLOCK_7__
Open a Pull Request from your forked branch on GitHub.
=��� License
Licensed under the ISC License. See the __INLINE_CODE_9__ file for details.
, 100); // "$ 100"
formatPrice('� ', -50); // "-� 50"
formatPrice('� ', 0); // "� 0"
formatPrice('�', 'text'); // "� 0"
>�� Contributing
Fork the repo
Clone your fork
__CODE_BLOCK_4__Create a branch
__CODE_BLOCK_5__Make your changes
Commit
__CODE_BLOCK_6__Push & PR
__CODE_BLOCK_7__
Open a Pull Request from your forked branch on GitHub.
=��� License
Licensed under the ISC License. See the __INLINE_CODE_9__ file for details.
, 100); // => "$ 100"
=���� Functionality
__CODE_BLOCK_2__- symbol: Currency symbol (e.g., __INLINE_CODE_0__, __INLINE_CODE_1__, __INLINE_CODE_2__)
- price: Number to format
=�� Returns:
- If __INLINE_CODE_3__ is 0 or not a number �! __INLINE_CODE_4__
- If __INLINE_CODE_5__ is negative �! __INLINE_CODE_6__
- If __INLINE_CODE_7__ is positive �! __INLINE_CODE_8__
=ء� Examples
__CODE_BLOCK_3__>�� Contributing
Fork the repo
Clone your fork
__CODE_BLOCK_4__Create a branch
__CODE_BLOCK_5__Make your changes
Commit
__CODE_BLOCK_6__Push & PR
__CODE_BLOCK_7__
Open a Pull Request from your forked branch on GitHub.
=��� License
Licensed under the ISC License. See the __INLINE_CODE_9__ file for details.