himadripal commented on code in PR #7179:
URL: https://github.com/apache/arrow-rs/pull/7179#discussion_r2025338285
##########
arrow-cast/src/parse.rs:
##########
@@ -2780,6 +2827,55 @@ mod tests {
}
}
+ #[test]
+ fn test_parse_decimal_rounding() {
+ let test_rounding_for_e_notation_varying_scale = [
+ ("1.2345e4", "12345", 2),
+ ("12345e-5", "0.12", 2),
+ ("12345E-5", "0.123", 3),
+ ("12345e-5", "0.1235", 4),
+ ("1265E-4", ".127", 3),
+ ("12.345e3", "12345.000", 3),
+ ("1.2345e4", "12345", 0),
+ ("1.2345e3", "1235", 0),
+ ("1.23e-3", "0", 0),
+ ("123e-2", "1", 0),
+ ("-1e-15", "-0.0000000000", 10),
+ ("1e-15", "0.0000000000", 10),
+ ("1e15", "1000000000000000", 2),
+ ];
Review Comment:
there are existing tests for such scenarios
[here](https://github.com/apache/arrow-rs/pull/7179/files#diff-cd568dd408cf11db340aa0259545de48fca7a0c0ac680bb9ff9a34956bab52b1L2537-L2558).
Nevertheless, I'll add these as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]