Skip to content

Sign loss while parsing rust_decimal::Decimal to sqlx::postgres::types::PgMoney #1321

Closed
@Kengyen

Description

@Kengyen
    let foo = Decimal::new(-314, 2);
    let bar = PgMoney::from_decimal(foo, 2);
    let baz = bar.to_decimal(2);
    println!("foo={} bar={:?} baz={}", foo, bar, baz); // foo=-3.14 bar=PgMoney(314) baz=3.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions