Skip to content
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

Output the fractional part of floating numbers only if needed #79

Merged
merged 3 commits into from
May 5, 2024

Conversation

PalmtopTiger
Copy link
Contributor

@PalmtopTiger PalmtopTiger commented Nov 19, 2023

Now, if there is a line

Style: Default,Arial,44,&H00EDE0E9,&H000000FF,&H00000000,&HC8000000,0,0,0,0,100,100,0,0,1,0,0,2,10,10,10,0

in the input file, it will be output as

Style: Default,Arial,44.0,&H00EDE0E9,&H000000FF,&H00000000,&HC8000000,0,0,0,0,100.0,100.0,0.0,0.0,1,0.0,0.0,2,10,10,10,0

With this patch, the line will retain its original form. That is, floating numbers with no fractional part are output without ".0" at the end. Numbers with a fractional part, such as 12.3, will keep it.

@PalmtopTiger PalmtopTiger changed the title Prevent numbers without fractional part from being output as 1.0 Output the fractional part of floating numbers only if needed Nov 20, 2023
@tkarabela
Copy link
Owner

Hi @PalmtopTiger , I see you're working on this :) I'd like to merge this for the soon upcoming 1.7.0 release, I'll wait till it's ready and merge it.

@PalmtopTiger
Copy link
Contributor Author

Hi, I updated the patch to match the upstream changes. Now it is ready to merge.

Copy link

codecov bot commented May 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.94%. Comparing base (cfcb02f) to head (8f66850).

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #79   +/-   ##
=======================================
  Coverage   92.93%   92.94%           
=======================================
  Files          36       36           
  Lines        2478     2481    +3     
  Branches      420      422    +2     
=======================================
+ Hits         2303     2306    +3     
  Misses        117      117           
  Partials       58       58           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tkarabela tkarabela merged commit f3b178f into tkarabela:master May 5, 2024
8 checks passed
@tkarabela
Copy link
Owner

Thanks :)

@PalmtopTiger PalmtopTiger deleted the float-fields-fix branch May 6, 2024 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants