How to use the currency-formatter/currencies.map function in currency-formatter

To help you get started, we’ve selected a few currency-formatter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jozsi / mystash / src / frontend / components / WalletAdd.jsx View on Github external
import currencies from 'currency-formatter/currencies';
import escapeStringRegexp from 'escape-string-regexp';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import Button from 'grommet/components/Button';
import Footer from 'grommet/components/Footer';
import Form from 'grommet/components/Form';
import FormField from 'grommet/components/FormField';
import FormFields from 'grommet/components/FormFields';
import Header from 'grommet/components/Header';
import Heading from 'grommet/components/Heading';
import NumberInput from 'grommet/components/NumberInput';
import Select from 'grommet/components/Select';
import TextInput from 'grommet/components/TextInput';

const currencyList = currencies.map(currency => ({
  value: currency.code,
  label: `${currency.code} (${currency.symbol})`,
}));

class WalletAdd extends Component {
  static propTypes = {
    onAdd: PropTypes.func,
  }

  static defaultProps = {
    onAdd: () => {},
  }

  constructor(props) {
    super(props);

currency-formatter

A simple Javascript utility that helps you to display currency properly

MIT
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis