Skip to content

feat: mimic excel behavior to convert float to string #292

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

Merged
merged 6 commits into from
Oct 7, 2024
Merged

Conversation

PrettyWood
Copy link
Collaborator

@PrettyWood PrettyWood commented Oct 2, 2024

closes #289

Copy link
Collaborator

@lukapeschke lukapeschke left a comment

Choose a reason for hiding this comment

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

Perfect

@PrettyWood PrettyWood changed the title feat: use rust_decimal smart display for float representation as string feat: mimic excel behavior to convert float to string Oct 4, 2024
@PrettyWood PrettyWood requested a review from lukapeschke October 4, 2024 16:23
Copy link
Collaborator

@lukapeschke lukapeschke left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

/// ... | ... | ...
/// 123456.123456789 | 123456.1235 | 123456.1
///
/// Excel also trims trailing zeros and the decimal point if there are no fractional part.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// Excel also trims trailing zeros and the decimal point if there are no fractional part.
/// Excel also trims trailing zeros and the decimal point if there is no fractional part.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

/// Excel also trims trailing zeros and the decimal point if there are no fractional part.
///
/// We have no notion of wide cell or standard cell here so we keep at most 9 digits after the
/// decimal point and trim trailing zeros.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// decimal point and trim trailing zeros.
/// decimal point and trim trailing zeroes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I prefer this spelling which is more common

@lukapeschke lukapeschke merged commit 5383632 into main Oct 7, 2024
23 checks passed
@lukapeschke lukapeschke deleted the fix/289 branch October 7, 2024 13:04
@PrettyWood PrettyWood self-assigned this Oct 14, 2024
@PrettyWood PrettyWood added the enhancement New feature or request label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

29.02 cell cast to 29.020000000000003 string
2 participants