So the float is converted to an int. I lost my decimal information.
System Information
pygsheets version : 2.0.3.1
Cause:numericise() is structured to only receive strings as input. However, when using ValueRenderOption.UNFORMATTED_VALUE, numericise() receives ints or floats.
Doing int(value) on a float value gives no error, hence an int is returned.
Workaround
Calling get_as_df() with numerize=False works, but then empty values are not converted anymore and I need this.
Proposed solution
Adapt numericise(): if value is not a string, return it as is. Only apply the conversion logic if value is a string.
Problem
get_as_df(value_render=ValueRenderOption.UNFORMATTED_VALUE)
converts floats to int.To Reproduce
34,521.95
, with.
as decimal separator and,
as thousands separator34521.95
in cell A1 of the first worksheetSo the float is converted to an int. I lost my decimal information.
System Information
Cause:
numericise()
is structured to only receive strings as input. However, when using ValueRenderOption.UNFORMATTED_VALUE, numericise() receives ints or floats. Doingint(value)
on a float value gives no error, hence an int is returned.Workaround Calling get_as_df() with
numerize=False
works, but then empty values are not converted anymore and I need this.Proposed solution Adapt numericise(): if
value
is not a string, return it as is. Only apply the conversion logic ifvalue
is a string.