the-simplifier
  • ๐Ÿ’šWelcome!
  • ๐Ÿ“ฆInstalling
  • Functions
    • The Simplifier Functions
  • ๐ŸŽซValidators
    • ๐ŸŸขisWebsiteUp
    • #๏ธโƒฃ isValidHexColor
  • ๐ŸŽกConverters
    • โฑ๏ธconvertTime
    • ๐Ÿ”ตconvertColors
  • ๐Ÿ“”Formatters
    • ๐Ÿ”ขNumberFormatter
  • ๐Ÿ“ธOCR
    • ๐Ÿ“‘๐Ÿ“ท readImage
  • โŒFakes
    • ๐ŸงชcreateFakeUser
  • ๐Ÿ”…Modified native functions
    • ๐Ÿ“œMap
  • ๐ŸŒNo category
    • ๐Ÿ”ƒgetRandomFromArray
    • ๐Ÿ” generateChars
    • ๐Ÿ”„getRandomInt
Powered by GitBook
On this page

Was this helpful?

  1. Formatters

NumberFormatter

Examples using all formatters available.

formatter.js
import { NumberFormatter } from 'the-simplifier'

const format = async() => {
  const result = await NumberFormatter(5000, {
    formatter: '.'
  })

  console.log(result)
}

format() // Expected: 5.000
formatter.js
import { NumberFormatter } from 'the-simplifier'

const format = async() => {
  const result = await NumberFormatter(5000, {
    formatter: ','
  })

  console.log(result)
}

format() // Expected: 5,000
formatter.js
import { NumberFormatter } from 'the-simplifier'

const format = async() => {
  const result = await NumberFormatter(5000, {
    formatter: ' '
  })

  console.log(result)
}

format() // Expected: 5 000
formatter.js
import { NumberFormatter } from 'the-simplifier'

const format = async() => {
  const result = await NumberFormatter(5000, {
    formatter: '-'
  })

  console.log(result)
}

format() // Expected: 5-000

PreviousFormattersNextOCR

Last updated 4 years ago

Was this helpful?

๐Ÿ“”
๐Ÿ”ข