Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-custom-number

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-custom-number

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

React Custom Number

Install

$ npm install react-custom-number or $ yarn add react-custom-number

Examples

import React, { useState } from 'react';
import CustomNumber from 'react-custom-number';
 
export default function App(){
    const [ value, setValue ] = useState('0');

    function onChange(e) {
        setValue(e.target.value);
    }

    return (
        <div>
            <CustomNumber 
                prefix="R$ " 
                thousandsSeparator="." 
                decimalSeparator="," 
                onChange={onChange}
            />
        </div>
    );
}

import React, { useState } from 'react';
import CustomNumber from 'react-custom-number';
 
export default function App(){
    const [ value, setValue ] = useState('0');

    function onChange(e) {
        setValue(e.target.value);
    }

    return (
        <div>
            <CustomNumber 
                suffix=" %"
                thousandsSeparator="." 
                decimalSeparator="," 
                onChange={onChange}
            />
        </div>
    );
}

Properties

In addition to having all the properties of an HTML input, CustomNumber has the following properties:

NameTypeDefault Value
prefixString""
suffixString""
placesNumber2
decimalSeparatorString"."
thousandsSeparatorString","
thousandsGroupNumber3

FAQs

Package last updated on 18 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc