Socket
Book a DemoInstallSign in
Socket

@plasma-platform/currency-formatter

Package Overview
Dependencies
Maintainers
8
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@plasma-platform/currency-formatter

Currency formatting depending on locale

latest
npmnpm
Version
1.1.0
Version published
Maintainers
8
Created
Source

version nextVersion downloads license dependency

Full documentation
install:
npm i @plasma-platform/currency-formatter -S

Short documentation

Table of Contents

priceConversion

Price conversion from dollar to currency

Parameters

  • params object
    • params.price number price by dollar
    • params.rate number currency rate
    • params.roundingType string type of rounding

Returns number converted price with Math.round

backPriceConversion

Price conversion from currency to dollar

Parameters

  • params object
    • params.price number price by currency
    • params.rate number currency rate
    • params.roundingType string type of rounding

Returns number converted price with Math.round

getTmLocale

Get TM locale (TM locales: en, de, es, fr, it, uk, pl, tr, cs, nl, hu, sv, pt, ar, zh, ru)

Parameters

  • locale string locale to convert to tm locale

Returns string tm locale

getCurrencyByLang

Get currency code by lang (TM currencies: USD, EUR, PLN, TRY, CNY, BRL, HUF, SEK)

Parameters

  • lang string language to get tm currency

Returns string currency code

currencyFormatter

Currency formatting by locale using Intl.NumberFormat

Parameters

Returns string formatted convertible price string

Keywords

TM Micro Service

FAQs

Package last updated on 03 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts