Open lollita opened 2 years ago
Hi,
Yes, as you can see, notecalc-lib is a separate library, so you can include it in your app and feed any string into it. You can find some examples in the benchmark folder (benchmarks were implemented as a binary crate using notecalc as a library, the same way as your wished feature).
Though, the ergonomics are not the best, since the notecalc lib handles text editor and other functionalities as well, also one of the strength of notecalc is being a multilne calculator, referencing other lines in your formula, or calculating averages or sums of many lines.
Of course, I saw it. But inside there are very things and it is difficult to isolate you only the routine that seemed the calculations and generally use it in another context.
Do it is possible to have a isolated function or library that parse the line and return the result? also in wasm. f.e. parse("calc = 5k + 4k"); that return 9 kg