Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Fractional numbers such as ".01" get displayed as "0.01" #550

Closed

Description

@Lekensteyn

A minor issue, but it differs from ruby-sass. Consider this test case:

#foo {
  d: .0001px;
  f: .01px;
  d: -.0001px;
  f: -.01px;
}

The expected result after passing through sassc is the the identity. I actually got this instead:

#foo {
  d: 0.0001px;
  f: 0.01px;
  d: -0.0001px;
  f: -0.01px;
}

According to CSS 3, 4.2. Numbers: the number type, a number is either an integer or zero or more integers followed by a dot, followed by one or more digits.

Activity

  1. mgol commented on Oct 17, 2014

    @mgol

    Confirmed; in my app it's one of the remaining differences from the version compiled via Ruby Sass.

  2. jschulte commented on Oct 18, 2014

    @jschulte

    I noticed this as well recently while working on Libsass 3.0, but decided it wasn't worth the effort to solve because there is no functional difference. Also, as you pointed out, "a number is either an integer or zero or more integers followed by a dot, followed by one or more digits". The way I read it, this isn't necessarily wrong, just slightly different from how it was done in Ruby Sass. It would be good to solve but shouldn't cause any issues for users.

  3. mgreter commented on Oct 18, 2014

    @mgreter
    Contributor

    This nuance is found here, if anyone cares to fix it: b860361#diff-cfe40fe6863b6bef68e57af57bca1155L324

  4. jschulte commented on Oct 18, 2014

    @jschulte

    Ooh, there you go. I'll work on getting a pull request in to fix that. :)

  5. mgreter commented on Oct 18, 2014

    @mgreter
    Contributor

    PRs are always welcome :)

  6. Lekensteyn commented on Oct 18, 2014

    @Lekensteyn
    Author

    Nice, I had no idea where to look for a possible fix. Thank you for picking it up!

  7. added this to the 3.1 milestone on Oct 18, 2014
  8. xzyfer commented on Oct 29, 2014

    @xzyfer
    Contributor

    Spec added sass/sass-spec#105.

  9. added a commit that references this issue on Nov 6, 2014
    ca82f08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions