0.0.18 • Published 4 years ago

@ribeiroevandro/helpers v0.0.18

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

MyTool - Helpers

Functionalities

Helper function that assists in applying monetary mask.

How to use:

Install

Install the library using yarn or npm:

yarn add @ribeiroevandro/helpers
or
npm install @ribeiroevandro/helpers

Using

Import the library like this:

import { normalizeMoney } from '@ribeiroevandro/helpers';

To use, just run it where you want and provide the necessary parameters, for example:

normalizeMoney(100, 'pt-BR');
// Ex: R$ 100,00

The function expects two arguments, an integer and a string. The number is the value you want to format and the string, which mask should be applied, by default if only the number is passed, the function will apply the Real (BRL) mask, but it is possible to format in Dollars (USD), it is enough that, in the second argument, it is passed 'en-US' and the return will be: A função espera dois argumentos, sendo um número inteiro e uma string. O número é o valor que deseja formatar e a string, qual máscara deverá ser aplicada, que pode ser 'pt-BR' para Real(BRL) ou 'en-US' para Dóllar(USD):

{
  normalizeMoney(100, 'pt-BR');
}
// Ex: R$ 100,00

// or

{
  normalizeMoney(100, 'en-US');
}
// Ex: $100.00

So far, these are the supported formats: pt-BR & en-US

0.0.18

4 years ago

0.0.16

4 years ago

0.0.17

4 years ago

0.0.14

4 years ago

0.0.15

4 years ago

0.0.12

4 years ago

0.0.13

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.1

4 years ago