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
1import { Currency } from "@ardenthq/sdk-intl";
Instantiating from ARK (with comma)
1Currency.fromString("Ѧ 0,0001");
Instantiating from Brazilian Real
1Currency.fromString("R$ 45,210.21");
Instantiating from USD
1Currency.fromString("$ 45.210,21");
Instantiating from ARK (with point)
1Currency.fromString("Ѧ 0.1000000081283");
Instantiating from a number
1Currency.fromString("52,21579");
Last updated 2 years ago
Edit Page