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

Remove redundant zeros from SVG files #442

Merged
merged 2 commits into from
Mar 3, 2024
Merged

Remove redundant zeros from SVG files #442

merged 2 commits into from
Mar 3, 2024

Conversation

RobinvanderVliet
Copy link
Contributor

All those redundant zeros are kind of wasteful, they don't add anything.

My SVG file went from 27 kB to 17 kB.

Screenshot SVG file

This method takes care of stripping redundant zeros at the end of a string.
@endroid
Copy link
Owner

endroid commented Mar 3, 2024

Nice, thank you. Wasn't aware all these zeroes were added. I think you can even do this in one line rtrim($string, '0.');

@endroid endroid merged commit 739fc54 into endroid:main Mar 3, 2024
3 checks passed
@RobinvanderVliet
Copy link
Contributor Author

Nice, thank you. Wasn't aware all these zeroes were added. I think you can even do this in one line rtrim($string, '0.');

I thought so at first, but that would change "10.0" to "1".

@endroid
Copy link
Owner

endroid commented Mar 5, 2024

Good point, you can use tag 5.0.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants