MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / trunc_dec_scale

Function trunc_dec_scale

tests/pi_tests.rs:21–29  ·  view source on GitHub ↗
(mut model: pi::Model)

Source from the content-addressed store, hash-verified

19
20pub async fn create_and_update_pi(db: &DatabaseConnection) -> Result<(), DbErr> {
21 fn trunc_dec_scale(mut model: pi::Model) -> pi::Model {
22 model.decimal = model.decimal.trunc_with_scale(3);
23 model.big_decimal = model.big_decimal.with_scale(3);
24 model.decimal_opt = model.decimal_opt.map(|decimal| decimal.trunc_with_scale(3));
25 model.big_decimal_opt = model
26 .big_decimal_opt
27 .map(|big_decimal| big_decimal.with_scale(3));
28 model
29 }
30
31 let pi = trunc_dec_scale(pi::Model {
32 id: 1,

Callers 1

create_and_update_piFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected