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

Simplify FixedDecimal's rounding APIs #5028

Merged
merged 11 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -490,11 +490,11 @@ impl CompactDecimalFormatter {
// If we have just one digit before the decimal point…
if significand.nonzero_magnitude_start() == 0 {
// …round to one fractional digit…
significand.half_even(-1);
significand.round(-1);
} else {
// …otherwise, we have at least 2 digits before the decimal point,
// so round to eliminate the fractional part.
significand.half_even(0);
significand.round(0);
}
let rounded_magnitude = significand.nonzero_magnitude_start() + i16::from(exponent);
if rounded_magnitude > log10_type {
Expand Down
34 changes: 7 additions & 27 deletions ffi/capi/bindings/c/ICU4XFixedDecimal.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions ffi/capi/bindings/c/ICU4XFixedDecimalRoundingMode.d.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions ffi/capi/bindings/c/ICU4XFixedDecimalRoundingMode.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 7 additions & 27 deletions ffi/capi/bindings/cpp/ICU4XFixedDecimal.d.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 7 additions & 27 deletions ffi/capi/bindings/cpp/ICU4XFixedDecimal.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

86 changes: 13 additions & 73 deletions ffi/capi/bindings/cpp/ICU4XFixedDecimal.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading