Skip to content

Rounding up to next 1's digit bug #55

@ntwilson

Description

@ntwilson

from the REPL:

> import Data.Formatter.Number
> numberFormatOptions = Formatter { abbreviations: false, after: 1, before: 0, comma: true, sign: false }                
> format numberFormatOptions 1.99
"1.10"

However, if there are no trailing digits, it seems to work

> import Data.Formatter.Number
> numberFormatOptions = Formatter { abbreviations: false, after: 0, before: 0, comma: true, sign: false }
> format numberFormatOptions 1.9  
"1"

though it's an interesting behavior in that it floors instead of rounds, when other digits do round:

> import Data.Formatter.Number
> numberFormatOptions = Formatter { abbreviations: false, after: 1, before: 0, comma: true, sign: false }
> format numberFormatOptions 1.39
"1.4"

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething that should function correctly isn't.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions