2.0.4 • Published 2 years ago

react-easy-format v2.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-easy-format

Made with create-react-library

Usually we format a string requires a fairly long javascript function. For example, in formatting currency, we search for it on google and then paste the code in our project. With this library, work will be shorter and more efficient.

Install

npm install --save react-easy-format

or

yarn add react-easy-format

Usage

import { Currency, DateFormat, Word } from 'react-easy-format'
import 'react-easy-format/dist/index.css'

class Example extends Component {
  render() {
    <>
      <Currency value={1000} format="IDR"> // result IDR 1,000
      <Currency value={1000000} format="Rp" separator="." /> // result Rp 1.000.000
      <DateFormat value="1997-08-08" format="D, d F Y" /> // result Sabtu, 08 Agustus 1997
      <DateFormat value="1997-08-08 12:00:00" format="D, d m Y H:i:s" /> // result Sabtu, 08 08 1997 12:00:00
      <Word value="Agun Buhori Ganteng" format="slug" /> // result agun-buhori-ganteng
      <Word value="Agun Buhori Ganteng" format="camel" /> // result agunBuhoriGanteng
      <Word value="agun buhori ganteng" format="title" /> // result Agun Buhori Ganteng
    </>
  }
}

License

MIT © agunbuhori

2.0.4

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago