You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When set the floatprecision digits in the options, for example with
options={'floatprecision': 4}
config.apply_options(options,pdtable)
then the negative numbers are not represented with the given precision, but they are represented in scientific notation.
Looking to the code it seems to be a wanted behavior, i.e.
pandastable\core.py
def setPrecision(self, x, p):
"""Set precision of a float value"""
if not pd.isnull(x):
if x<1:
x = '{:.{}g}'.format(x, p)
elif self.thousandseparator == ',':
x = '{:,.{}f}'.format(x, p)
else:
x = '{:.{}f}'.format(x, p)
return x
but could it be modified it as the following (preserving the scientific notation for the numbers between (-1,1))?
def setPrecision(self, x, p):
"""Set precision of a float value"""
if not pd.isnull(x):
if x>-1 and x<1:
x = '{:.{}g}'.format(x, p)
elif self.thousandseparator == ',':
x = '{:,.{}f}'.format(x, p)
else:
x = '{:.{}f}'.format(x, p)
return x
The text was updated successfully, but these errors were encountered:
When set the floatprecision digits in the options, for example with
options={'floatprecision': 4}
config.apply_options(options,pdtable)
then the negative numbers are not represented with the given precision, but they are represented in scientific notation.
Looking to the code it seems to be a wanted behavior, i.e.
pandastable\core.py
but could it be modified it as the following (preserving the scientific notation for the numbers between (-1,1))?
The text was updated successfully, but these errors were encountered: