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

PR: Fix format specifier for integers in array and dataframe editors (Variable explorer) #23782

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jsbautista
Copy link
Contributor

Description of Changes

Fix float format specifier for an integer datatype in variable explorer.

Issue(s) Resolved

Fixes #22629

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:
@jsbautista

@ccordoba12 ccordoba12 changed the title PR: fix format variable explorer PR: Fix format specifier for integers in array and dataframe editors (Variable explorer) Feb 21, 2025
@ccordoba12 ccordoba12 added this to the v6.0.5 milestone Feb 21, 2025
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a bit more work @jsbautista, see below.

Comment on lines 1134 to 1135
if dialog.float_format == 'd':
dialog.float_format = '.0f'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the right place to do this because we haven't processed yet the dialog info introduced by the user. Instead, please move these lines below line 1143, like this:

if float_format == 'd':
    float_format = '.0f'

In addition, please do the same for our dataframe editor, specifically here to have feature parity between the two editors:

if result == QDialog.Accepted:
float_format = dialog.float_format

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.

Format (d) is incorrect in Numpy array viewer
2 participants