PR: Use .format() to format floats in array and dataframe editors #20473
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Changes
Use
format()
instead of the%
operator to format floating-point numbers in the array and dataframe editors, because this has more functionality and it is modern Python style instead of C-style priintf. For example, with.format()
you can specify a thousands separator with,
in the format specifier, as shown in the animation below.A difference with the current version is that there is no initial
%
character in the format specifier: the user should now give the format as.6g
instead of%.6g
. However, the config option never had the%
character in it, so there is no hange in the configuration.The second commit contains the actual change from
%
to.format()
, the other commits are preparation and tidying up.Issue(s) Resolved
Fixes #14518
Affirmation
By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.
I certify the above statement is true and correct: Jitse Niesen