Skip to content

Commit

Permalink
Implement expand_to_increment for FixedDecimal (unicode-org#4243)
Browse files Browse the repository at this point in the history
  • Loading branch information
jedel1043 authored Nov 1, 2023
1 parent 3fdb955 commit b8cacd3
Show file tree
Hide file tree
Showing 9 changed files with 581 additions and 53 deletions.
2 changes: 2 additions & 0 deletions ffi/capi/c/include/ICU4XFixedDecimal.h

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

5 changes: 5 additions & 0 deletions ffi/capi/cpp/docs/source/fixed_decimal_ffi.rst

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

2 changes: 2 additions & 0 deletions ffi/capi/cpp/include/ICU4XFixedDecimal.h

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

10 changes: 10 additions & 0 deletions ffi/capi/cpp/include/ICU4XFixedDecimal.hpp

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

5 changes: 5 additions & 0 deletions ffi/capi/js/docs/source/fixed_decimal_ffi.rst

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

6 changes: 6 additions & 0 deletions ffi/capi/js/include/ICU4XFixedDecimal.d.ts

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

4 changes: 4 additions & 0 deletions ffi/capi/js/include/ICU4XFixedDecimal.js

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

10 changes: 10 additions & 0 deletions ffi/capi/src/fixed_decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,16 @@ pub mod ffi {
self.0.expand(position)
}

#[diplomat::rust_link(fixed_decimal::FixedDecimal::expand_to_increment, FnInStruct)]
#[diplomat::rust_link(
fixed_decimal::FixedDecimal::expanded_to_increment,
FnInStruct,
hidden
)]
pub fn expand_to_increment(&mut self, position: i16, increment: ICU4XRoundingIncrement) {
self.0.expand_to_increment(position, increment.into())
}

#[diplomat::rust_link(fixed_decimal::FixedDecimal::half_expand, FnInStruct)]
#[diplomat::rust_link(fixed_decimal::FixedDecimal::half_expanded, FnInStruct, hidden)]
pub fn half_expand(&mut self, position: i16) {
Expand Down
Loading

0 comments on commit b8cacd3

Please sign in to comment.