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

Add parsable raw string representation of Money object #1612

Closed
wants to merge 3 commits into from

Conversation

filipmacek
Copy link
Member

Pull Request

Currently to_str function of Money object returns a string representation of a number with an underscore. For example, we return 10_000.00 USD instead of more native 10000.00 USD(and easier to parse by other systems).
This looks right in logging where its easier to see bigger numbers with this separator but poses a problem for parsing with Rust where we cannot deserialize it back to the Money type. A lot of these from_dict functions rely on serde_json to convert it back to native Rust type, and they fail on Money type deserialization
So to_raw_str was created to represent this more parsing-friendly format and it was added across to_dict method of instruments

@filipmacek filipmacek added the python Pull requests that update Python code label Apr 26, 2024
@filipmacek filipmacek requested a review from cjdsellers April 26, 2024 16:50
@filipmacek filipmacek self-assigned this Apr 26, 2024
@filipmacek filipmacek force-pushed the money-object-to-str branch from ee7027f to e9f6daa Compare April 26, 2024 19:17
@filipmacek
Copy link
Member Author

Closing, as it was resolved by Rust parsing fix

@filipmacek filipmacek closed this Apr 27, 2024
@filipmacek filipmacek deleted the money-object-to-str branch April 27, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant