Skip to content

A business-quality formatting package with reified formats for multiple data types

License

Notifications You must be signed in to change notification settings

portnov/formattable

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

formattable

A business-quality formatting package with reified formats for multiple data types

This package provides excellent support for formatting numbers including the following configurable features:

  • units (thousands, millions, percent, etc)
  • prefixes ($, £, etc)
  • suffixes (%, ¢, etc)
  • decimal separators
  • thousands separators
  • styles for fixed decimal notation, scientific notation, and SI prefixes
  • specify precision as number of decimal places or sig figs
  • different styles of negative numbers

Examples

  • runFormat (intFmt { _nfStyle = SIStyle }) (225142.3 :: Double) == "225k"

See the test suite for more examples.

About

A business-quality formatting package with reified formats for multiple data types

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Haskell 100.0%