Currency
The Currency
class provides methods to extract the numerical value out of any currency representation by normalizing the input and removing any locale specific rules like symbols and use of commas.
Importing the Currency class
import { Currency } from "@arkecosystem/platform-sdk-intl";
Instantiating from ARK (with comma)
Currency.fromString("Ѧ 0,0001");
Instantiating from Brazilian Real
Currency.fromString("R$ 45,210.21");
Instantiating from USD
Currency.fromString("$ 45.210,21");
Instantiating from ARK (with point)
Currency.fromString("Ѧ 0.1000000081283");
Instantiating from a number
Currency.fromString("52,21579");
Last updated 1 month ago
Edit Page