Skip to content

Allow rounding optionΒ #62

@MartijnCuppens

Description

@MartijnCuppens

This option allows users to limit the default precision to what's defined in precision, but doesn't round the number if the rounded number isn't equal to the number itself. This may sound a bit vague, so let's demonstrate this with an example:

Let's assume you have configured precision: 5 and allowRounding: false:

  • calc(100% / 3) will output calc(100% / 3) because calc(100% / 3) != 33.33333%
  • calc(100% / 4) will output 25% because calc(100% / 4) == 25%

What's the advantage? We never have rounded numbers which can cause issues like twbs/bootstrap#27374 and we don't have expressions like calc(100% / 4) that can be simplified.

PR: #61

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions