linkedin / linkedin/dustjs

Zero values stripped from decimals on compilation

Open
#784 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
2.9k
Forks
461
PR merge metrics
No merged PRs in 30d

Description

![screen shot 2018-09-05 at 4 29 05 pm](https://user-images.githubusercontent.com/5490714/45071112-d3802900-b128-11e8-9224-062fb163efdd.png)

Found this issue while working on a template using multiple decimal values, if you pass through a value like 0.05, the compiler will strip out all zeroes after the decimal point making 0.05 -> 0.5 after compiling. This doesn't happen to decimals without zeroes as 0.15 still compiles to 0.15.

Screenshot above shows a few different tests with these scenarios, including passing in a variable as 0.05 which works as expected.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the compiler behavior described in the issue with a literal 0.05 and a variable containing 0.05, then trace the decimal-literal compilation path. Done means decimal literals containing zeroes after the decimal point compile unchanged, while the existing variable behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.