How to use Currency Symbols in React Native

Currency Symbols in React Native

This is an example of How to use Currency Symbols in React Native. React Native Currency Symbols are not so different they are similar to HTML Unicode. Whenever we make an E-commerce or any budget app where we have to show some amount or currency, we can use the currency symbol to understand it easily. Here is the list of some Currencies with there Unicode. Hope it will help you.

Note: We are using the HTML Unicode If we missed any currency simply search on Google for currency Unicode. For example Indian Rupees Unicode.

List of Currency and Unicode

Currency Unicode
DOLLAR SIGN \u0024
CENT SIGN \u00A2
POUND SIGN \u00A3
YEN SIGN \u00A5
ARMENIAN DRAM SIGN \u058F
AFGHANI SIGN \u060B
BENGALI RUPEE MARK \u09F2
BENGALI RUPEE SIGN \u09F3
BENGALI GANDA MARK \u09FB
GUJARATI RUPEE SIGN \u0AF1
TAMIL RUPEE SIGN \u0BF9
THAI CURRENCY SYMBOL BAHT \u0E3F
KHMER CURRENCY SYMBOL RIEL \u17DB
EURO-CURRENCY SIGN \u20A0
COLON SIGN \u20A1
CRUZEIRO SIGN \u20A2
FRENCH FRANC SIGN \u20A3
LIRA SIGN \u20A4
MILL SIGN \u20A5
NAIRA SIGN \u20A6
PESETA SIGN \u20A7
RUPEE SIGN \u20A8
WON SIGN \u20A9
NEW SHEQEL SIGN \u20AA
DONG SIGN \u20AB
EURO SIGN \u20AC
KIP SIGN \u20AD
TUGRIK SIGN \u20AE
DRACHMA SIGN \u20AF
GERMAN PENNY SIGN \u20B0
PESO SIGN \u20B1
GUARANI SIGN \u20B2
AUSTRAL SIGN \u20B3
HRYVNIA SIGN \u20B4
CEDI SIGN \u20B5
LIVRE TOURNOIS SIGN \u20B6
SPESMILO SIGN \u20B7
TENGE SIGN \u20B8
INDIAN RUPEE SIGN \u20B9
TURKISH LIRA SIGN \u20BA
NORDIC MARK SIGN \u20BB
MANAT SIGN \u20BC
RUBLE SIGN \u20BD
LARI SIGN \u20BE
BITCOIN SIGN \u20BF
NORTH INDIC RUPEE MARK \uA838
RIAL SIGN \uFDFC
SMALL DOLLAR SIGN \uFE69
FULLWIDTH DOLLAR SIGN \uFF04
FULLWIDTH CENT SIGN \uFFE0
FULLWIDTH POUND SIGN \uFFE1
FULLWIDTH YEN SIGN \uFFE5
FULLWIDTH WON SIGN \uFFE6

You can Use this Unicodes Using

<Text>{'\u20AF'}</Text>

To Make a React Native App

Getting started with React Native will help you to know more about the way you can make a React Native project. We are going to use react native command line interface to make our React Native App.

If you have previously installed a global react-native-cli package, please remove it as it may cause unexpected issues:

npm uninstall -g react-native-cli @react-native-community/cli

Run the following commands to create a new React Native project

npx react-native init ProjectName

If you want to start a new project with a specific React Native version, you can use the --version argument:

npx react-native init ProjectName --version X.XX.X

Note If the above command is failing, you may have old version of react-native or react-native-cli installed globally on your pc. Try uninstalling the cli and run the cli using npx.

This will make a project structure with an index file named App.js in your project directory.

Code

Open App.js in any code editor and replace the code with the following code

App.js

// How to use Currency Symbols in React Native
// https://aboutreact.com/react-native-currency-symbols/

// import React in our code
import React from 'react';

// import all the components we are going to use
import {
  SafeAreaView,
  StyleSheet,
  View,
  Text,
  ScrollView
} from 'react-native';

const App = () => {
  return (
    <SafeAreaView style={{flex: 1}}>
      <View style={styles.container}>
        <Text style={styles.titleText}>
          How to use Currency Symbols in React Native
        </Text>
        <ScrollView>
          {/*To show overflowing content*/}
          <View>
            {/*To wrap multiple text*/}
            <Text style={styles.textStyle}>
              DOLLAR SIGN -- {'\u0024'}
            </Text>
            <Text style={styles.textStyle}>
              CENT SIGN -- {'\u00A2'}
            </Text>
            <Text style={styles.textStyle}>
              POUND SIGN -- {'\u00A3'}
            </Text>
            <Text style={styles.textStyle}>
              YEN SIGN -- {'\u00A5'}
            </Text>
            <Text style={styles.textStyle}>
              ARMENIAN DRAM SIGN -- {'\u058F'}
            </Text>
            <Text style={styles.textStyle}>
              AFGHANI SIGN -- {'\u060B'}
            </Text>
            <Text style={styles.textStyle}>
              BENGALI RUPEE MARK -- {'\u09F2'}
            </Text>
            <Text style={styles.textStyle}>
              BENGALI RUPEE SIGN -- {'\u09F3'}
            </Text>
            <Text style={styles.textStyle}>
              BENGALI GANDA MARK -- {'\u09FB'}
            </Text>
            <Text style={styles.textStyle}>
              GUJARATI RUPEE SIGN -- {'\u0AF1'}
            </Text>
            <Text style={styles.textStyle}>
              TAMIL RUPEE SIGN -- {'\u0BF9'}
            </Text>
            <Text style={styles.textStyle}>
              THAI CURRENCY SYMBOL BAHT -- {'\u0E3F'}
            </Text>
            <Text style={styles.textStyle}>
              KHMER CURRENCY SYMBOL RIEL -- {'\u17DB'}
            </Text>
            <Text style={styles.textStyle}>
              EURO-CURRENCY SIGN -- {'\u20A0'}
            </Text>
            <Text style={styles.textStyle}>
              COLON SIGN -- {'\u20A1'}
            </Text>
            <Text style={styles.textStyle}>
              CRUZEIRO SIGN -- {'\u20A2'}
            </Text>
            <Text style={styles.textStyle}>
              {' '}
              FRENCH FRANC SIGN -- {'\u20A3'}
            </Text>
            <Text style={styles.textStyle}>
              LIRA SIGN -- {'\u20A4'}
            </Text>
            <Text style={styles.textStyle}>
              MILL SIGN -- {'\u20A5'}
            </Text>
            <Text style={styles.textStyle}>
              NAIRA SIGN -- {'\u20A6'}
            </Text>
            <Text style={styles.textStyle}>
              PESETA SIGN -- {'\u20A7'}
            </Text>
            <Text style={styles.textStyle}>
              RUPEE SIGN -- {'\u20A8'}
            </Text>
            <Text style={styles.textStyle}>
              WON SIGN -- {'\u20A9'}
            </Text>
            <Text style={styles.textStyle}>
              NEW SHEQEL SIGN -- {'\u20AA'}
            </Text>
            <Text style={styles.textStyle}>
              DONG SIGN -- {'\u20AB'}
            </Text>
            <Text style={styles.textStyle}>
              EURO SIGN -- {'\u20AC'}
            </Text>
            <Text style={styles.textStyle}>
              KIP SIGN -- {'\u20AD'}
            </Text>
            <Text style={styles.textStyle}>
              TUGRIK SIGN -- {'\u20AE'}
            </Text>
            <Text style={styles.textStyle}>
              DRACHMA SIGN -- {'\u20AF'}
            </Text>
            <Text style={styles.textStyle}>
              GERMAN PENNY SIGN -- {'\u20B0'}
            </Text>
            <Text style={styles.textStyle}>
              PESO SIGN -- {'\u20B1'}
            </Text>
            <Text style={styles.textStyle}>
              GUARANI SIGN -- {'\u20B2'}
            </Text>
            <Text style={styles.textStyle}>
              AUSTRAL SIGN -- {'\u20B3'}
            </Text>
            <Text style={styles.textStyle}>
              HRYVNIA SIGN -- {'\u20B4'}
            </Text>
            <Text style={styles.textStyle}>
              CEDI SIGN -- {'\u20B5'}
            </Text>
            <Text style={styles.textStyle}>
              {' '}
              LIVRE TOURNOIS SIGN -- {'\u20B6'}
            </Text>
            <Text style={styles.textStyle}>
              SPESMILO SIGN -- {'\u20B7'}
            </Text>
            <Text style={styles.textStyle}>
              TENGE SIGN -- {'\u20B8'}
            </Text>
            <Text style={styles.textStyle}>
              INDIAN RUPEE SIGN -- {'\u20B9'}
            </Text>
            <Text style={styles.textStyle}>
              TURKISH LIRA SIGN -- {'\u20BA'}
            </Text>
            <Text style={styles.textStyle}>
              NORDIC MARK SIGN -- {'\u20BB'}
            </Text>
            <Text style={styles.textStyle}>
              MANAT SIGN -- {'\u20BC'}
            </Text>
            <Text style={styles.textStyle}>
              RUBLE SIGN -- {'\u20BD'}
            </Text>
            <Text style={styles.textStyle}>
              LARI SIGN -- {'\u20BE'}
            </Text>
            <Text style={styles.textStyle}>
              BITCOIN SIGN -- {'\u20BF'}
            </Text>
            <Text style={styles.textStyle}>
              NORTH INDIC RUPEE MARK -- {'\uA838'}
            </Text>
            <Text style={styles.textStyle}>
              RIAL SIGN -- {'\uFDFC'}
            </Text>
            <Text style={styles.textStyle}>
              SMALL DOLLAR SIGN -- {'\uFE69'}
            </Text>
            <Text style={styles.textStyle}>
              FULLWIDTH DOLLAR SIGN -- {'\uFF04'}
            </Text>
            <Text style={styles.textStyle}>
              FULLWIDTH CENT SIGN -- {'\uFFE0'}
            </Text>
            <Text style={styles.textStyle}>
              FULLWIDTH POUND SIGN -- {'\uFFE1'}
            </Text>
            <Text style={styles.textStyle}>
              FULLWIDTH YEN SIGN -- {'\uFFE5'}
            </Text>
            <Text style={styles.textStyle}>
              FULLWIDTH WON SIGN -- {'\uFFE6'}
            </Text>
          </View>
        </ScrollView>
      </View>
    </SafeAreaView>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    padding: 10,
    backgroundColor: 'white',
  },
  titleText: {
    fontSize: 22,
    fontWeight: 'bold',
    paddingVertical: 20,
  },
  textStyle: {
    marginTop: 10,
    color: '#646464',
    fontSize: 16,
  },
  buttonStyle: {
    fontSize: 16,
    color: 'white',
    backgroundColor: 'green',
    padding: 5,
    marginTop: 32,
    minWidth: 250,
  },
  buttonTextStyle: {
    padding: 5,
    color: 'white',
    textAlign: 'center',
  },
});

export default App;

To Run the React Native App

Open the terminal again and jump into your project using.

cd ProjectName

1. Start Metro Bundler

First, you will need to start Metro, the JavaScript bundler that ships with React Native. To start Metro bundler run following command:

npx react-native start

Once you start Metro Bundler it will run forever on your terminal until you close it. Let Metro Bundler run in its own terminal. Open a new terminal and run the application.

2. Start React Native Application

To run the project on an Android Virtual Device or on real debugging device:

npx react-native run-android

or on the iOS Simulator by running (macOS only)

npx react-native run-ios

Output Screenshots

Output in Online Emulator

That was the React Native Currency Symbols. If you have any doubts or you want to share something about the topic you can comment below or contact us here. There will be more posts coming soon. Stay tuned!

Hope you liked it. 🙂

1 thought on “How to use Currency Symbols in React Native”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.