inkle / inkle/inky

Exporting small decimals produces invalid JSON

Open
#136 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.7k
Forks
340
PR merge metrics
No merged PRs in 30d

Description

When small decimal numbers are exported to JSON, the export uses exponential notation but gets the format wrong.

The following ink...

```
VAR epsilon = 0.000001
```
...exports to...
```
{"inkVersion":17,"root":["done",{"global decl":["ev",1E-06.0,{"VAR=":"epsilon"},"/ev","end",null],"#f":3}],"listDefs":{}}
```
...which is not valid JSON. Should be *1E-06*, not *1E-06.0*.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue by exporting the shown VAR epsilon = 0.000001 example and inspect the JSON export path; the issue names no file or test. Done means the exported value uses 1E-06 rather than 1E-06.0 and the result is valid JSON.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.