Skip to content

Fix for #1072: Fix format with general format type.#1073

Merged
sparkprime merged 1 commit into
google:masterfrom
netomi:fix_format_general
May 3, 2023
Merged

Fix for #1072: Fix format with general format type.#1073
sparkprime merged 1 commit into
google:masterfrom
netomi:fix_format_general

Conversation

@netomi
Copy link
Copy Markdown
Contributor

@netomi netomi commented Apr 18, 2023

This PR fixes format when using the general format type and passing a value of 0 like that

jsonnet -e "std.format('%g', [0])"

or

jsonnet -e "'%g' % 0"

It basically adds a safeguard when calculating the exponent for the given value. 0 has to be treated differently as log is not undefined for 0.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Apr 18, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@sparkprime sparkprime merged commit e6bf0ee into google:master May 3, 2023
@netomi netomi deleted the fix_format_general branch August 12, 2023 15:55
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