slamdata/purescript-formatters

Name: purescript-formatters

Owner: SlamData, Inc.

Description: A PureScript alternative to numeral.js, moment.js, etc.

Created: 2016-07-18 14:54:17.0

Updated: 2018-03-24 16:38:18.0

Pushed: 2018-05-19 15:51:02.0

Homepage:

Size: 81

Language: PureScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

purescript-formatters

Latest release Build status

A PureScript alternative to numeral.js, moment.js, etc.

Installation
r install purescript-formatters
Number formatters

Formatter has following properties

Number will be padded with zeros to have at least this number of leading zeros. This doesn't restrict number to have more digits then leading zeros in format string.

Number of digits after dot is set by number of trailing zeros (note the rounding)

If number is lesser then zero - is always printed. Otherwise you could specify + in format string

Thousands separator is specified as ,0 please note that this 0 isn't counted as leading.

For abbreviation one could use a flag. In general it tries to find the closest power of thousand and then use formatter to result of division of input number and that power.

Date/Time formatters

This is a subset of common format/parse strings currently supported.

Full list is defined here

Documentation

Module documentation is published on Pursuit: http://pursuit.purescript.org/packages/purescript-formatters


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.