1.0.0 • Published 4 years ago

react-number-formator v1.0.0

Weekly downloads
3
License
reactunlimited
Repository
github
Last release
4 years ago

react-number-formator

Primarily written for number formatting to be shown as human readable format. It accepts number only and converts it to three formats - original | result | short | easy

  • original - return original number sent by you
  • result - full conversion with unit
  • short - full conversion with short unit
  • easy - easy to read, no decimal places

can be used in both react and react-native

NPM JavaScript Style Guide

Install

for npm

npm install --save react-number-formator

for yarn

yarn add react-number-formator

Usage in React

import React, { Component } from 'react'

import RNFormator from 'react-number-formator'

class Example extends Component {
  render () {
    return (
      <div>
        Original Number : 100900000000000080
        <br/>
        Converted: {JSON.stringify(RNFormator(100900000000000080))}
      </div>
    )
  }
}

Usage in React

import React, { Component } from 'react'
import {View, Text} from 'react-native'
import RNFormator from 'react-number-formator'

export default function convert(props){

    return (
      <View>
      <Text>
        Original Number : 100900000000000080
        </Text>
        <Text>
        Converted: {JSON.stringify(RNFormator(100900000000000080))}
        </Text>
      </View>
    )

}

Response

Response image

License

reactunlimited © reactunlimited