This commit is contained in:
Kasper 2020-11-14 05:26:22 +01:00
parent 7284422ec0
commit efd5b63a0d
4 changed files with 11 additions and 6 deletions

View File

@ -1,3 +1,11 @@
## 1.1.0 - 2020 Nov 14
- Added units of frequency
- Added support using foot-inch syntax with addition, like `2"+6'4"`
- Unsupported foot-inch syntax like `(6)'4"` and `6'4!"` now cause errors
- Fixed README.md stating the performance is 1000x slower than it actually is
- Fixed trailing percentage signs being ignored when `allow_trailing_operators` is true
- Fixed error caused by consecutive percentage signs
## 1.0.2 - 2020 Oct 12
- Fix parsing of unit `Quarter` (#1)
- Use division instead of multiplication when dividing numbers of the same unit `Quarter` (#1)

2
Cargo.lock generated
View File

@ -12,7 +12,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "cpc"
version = "1.0.2"
version = "1.1.0"
dependencies = [
"decimal 2.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
]

View File

@ -1,6 +1,6 @@
[package]
name = "cpc"
version = "1.0.2"
version = "1.1.0"
description = "evaluates math expressions, with support for units and conversion between units"
authors = ["Kasper Henningsen"]
edition = "2018"

View File

@ -62,7 +62,7 @@ match eval("3m + 1cm", true, Unit::Celcius, false) {
(4 + 1)km to light years
10m/2s * 5s
10m/2s * 5 trillion s
1 lightyear * 0.001mm in km2
@ -165,9 +165,6 @@ match string {
```
### Potential Improvements
#### General
- The functions in units.rs have a lot of manual if statements. This could probably be replaced with a pretty advanced macro.
- Support for lexing words, like `one billion`
#### Potential unit types
Nice list of units: https://support.google.com/websearch/answer/3284611
- Currency: How would you go about dynamically updating the weights?