Closed ChristianIvicevic closed 6 months ago
Thank you for putting this together - it's looking very complete for a new feature! We'll need to play a little bit to get this working with CI. It'll likely be failing on the build all features step - unfortunately the step is required for documentation generation so I'll need to think about how to skirt around this (or whether it's still necessary).
Thank you for putting this together - it's looking very complete for a new feature! We'll need to play a little bit to get this working with CI. It'll likely be failing on the build all features step - unfortunately the step is required for documentation generation so I'll need to think about how to skirt around this (or whether it's still necessary).
Okay cool. Since I haven't been coding a lot in my free time lately, I haven't fully explored whether I'm fully happy with the from_number
function given it is fallible at the moment. Once I've confirmed I'm happy with the exposed API I can promote this draft to a full PR then we can explore the CI errors.
@paupino Just wanted to drop by and mention that I will not have time to finish this in the near future and plan to spend some time on it after Christmas at which point I can invest time to rebase and tweak the API properly.
Due to a minor conflict with an app of mine that depends on my personal fork I had to open an independent new PR #650 that provides the feature.
I've been exploring potential implementations and would like to discuss an initial, lightweight contribution. Instead of fully binding and exporting the entire crate, my intention is to simplify it by exporting the
Decimal
type to JavaScript and making it possible to map it to anumber
type. I don't anticipate performing operations onDecimal
s from the JavaScript side.To achieve all of this, I've added a conditional attribute to the
Decimal
struct and introduced two methods within a conditional module,Decimal::to_number
andDecimal::from_number
, inspired bydecimal.js
.Fixes #613