paupino / rust-decimal

Decimal number implementation written in pure Rust suitable for financial and fixed-precision calculations.
https://docs.rs/rust_decimal/
MIT License
1.03k stars 182 forks source link

Add lightweight wasm support to `rust-decimal` #650

Open ChristianIvicevic opened 8 months ago

ChristianIvicevic commented 8 months ago

A new optional feature 'wasm' has been introduced in the codebase. This enables wasm-bindgen support, making Decimal compatible with the wasm_bindgen attribute macro, and exposes fromNumber() and toNumber() methods to convert between Decimal and the primitive number type.

Fixes #613

ChristianIvicevic commented 8 months ago

I am not quite sure why the actions fail exactly but it feels like an issue with the macros crate referencing the published core crate which doesn't have the wasm support yet. Unfortunately I can't really figure out more than this. In the previous PR there were talks about having to adjust the CI most likely.

ChristianIvicevic commented 7 months ago

@paupino Were you able to set aside some time to investigate how to refactor the workflow in order to make this PR pass the pipeline?

paupino commented 7 months ago

@ChristianIvicevic I did start looking at it in this branch, however have yet to complete it. I'll see if I can pick it up again to get it over the line - it turns out to be a bit trickier than I anticipated!