New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix float formatting #2018
Fix float formatting #2018
Conversation
actions/runner actually also use double as json number type, see - run: echo '${{ fromJSON('1234567.0') }}'
- run: echo '${{ fromJSON('12345674444443322222222225') }}' log
However it uses different rules for converting them back to string |
See act/pkg/exprparser/interpreter.go Line 449 in b637d79
If you tell it to format it like dotnet in actions/runner then your usecase should work too |
Great observations and thanks for the additional context! I'll see if I can rework this PR to instead format floats the same way as actions/runner |
cd1d684
to
c1bba62
Compare
Ok, updated. Let me know if you have any additional suggestions around the tests 🙏 |
Codecov Report
@@ Coverage Diff @@
## master #2018 +/- ##
==========================================
+ Coverage 61.22% 61.77% +0.55%
==========================================
Files 46 52 +6
Lines 7141 8550 +1409
==========================================
+ Hits 4372 5282 +910
- Misses 2462 2846 +384
- Partials 307 422 +115
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing this. It has enough test in my opinion.
@cplee need me to do anything here? seems like an issue with the merge queue 🤔 |
press update branch and magic happens, too long but cplee didn't grant mergify workflow permission |
Format floats the same way as actions/runner (precision 15, remove trailing zeroes) See: https://github.com/actions/runner/blob/67d70803a95fca2fc86d89231acbc319f9a9be2a/src/Sdk/DTObjectTemplating/ObjectTemplating/Tokens/NumberToken.cs#L34
c1bba62
to
65e92b9
Compare
Format floats the same way as actions/runner (precision 15, remove trailing zeroes) See: https://github.com/actions/runner/blob/67d70803a95fca2fc86d89231acbc319f9a9be2a/src/Sdk/DTObjectTemplating/ObjectTemplating/Tokens/NumberToken.cs#L34
Format floats the same way as actions/runner (precision 15, remove trailing zeroes)
See: https://github.com/actions/runner/blob/67d70803a95fca2fc86d89231acbc319f9a9be2a/src/Sdk/DTObjectTemplating/ObjectTemplating/Tokens/NumberToken.cs#L34
Fixes #2017