Switch back to official decimal
Switch back to official `decimal` because https://github.com/alkis/decimal/issues/59 is fixed
This commit is contained in:
parent
065adb3d29
commit
1db9598cd2
8
Cargo.lock
generated
8
Cargo.lock
generated
@ -16,14 +16,14 @@ checksum = "95752358c8f7552394baf48cd82695b345628ad3f170d607de3ca03b8dacca15"
|
|||||||
name = "cpc"
|
name = "cpc"
|
||||||
version = "1.3.2"
|
version = "1.3.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"decimal_fixes_mirror",
|
"decimal",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "decimal_fixes_mirror"
|
name = "decimal"
|
||||||
version = "2.0.4-fix1.0.0"
|
version = "2.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "878957a52f4ae34351962b97a2bf349ec58cb86c91863e7b50f6f2c9bbd51ffa"
|
checksum = "5a8ab77e91baeb15034c3be91e87bff4665c9036216148e4996d9a9f5792114d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"cc",
|
"cc",
|
||||||
|
|||||||
@ -13,5 +13,4 @@ keywords = ["math", "expression", "evaluate", "units", "convert"]
|
|||||||
categories = ["mathematics", "science", "parsing", "text-processing", "value-formatting"]
|
categories = ["mathematics", "science", "parsing", "text-processing", "value-formatting"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# decimal = "2.0.4"
|
decimal = "2.1.0"
|
||||||
decimal_fixes_mirror = "2.0.4-fix1.0.0"
|
|
||||||
|
|||||||
17
README.md
17
README.md
@ -8,7 +8,6 @@ cpc parses and evaluates strings of math, with support for units and conversion.
|
|||||||
|
|
||||||
It also lets you mix units, so for example `1 km - 1m` results in `Number { value: 999, unit: Meter }`.
|
It also lets you mix units, so for example `1 km - 1m` results in `Number { value: 999, unit: Meter }`.
|
||||||
|
|
||||||
|
|
||||||
[](https://crates.io/crates/cpc)
|
[](https://crates.io/crates/cpc)
|
||||||
[](https://docs.rs/cpc)
|
[](https://docs.rs/cpc)
|
||||||
|
|
||||||
@ -171,14 +170,14 @@ match string {
|
|||||||
### Potential Improvements
|
### Potential Improvements
|
||||||
- Support for conversion between Power, Current, Resistance and Voltage. Multiplication and division is currently supported, but not conversions using sqrt or pow.
|
- Support for conversion between Power, Current, Resistance and Voltage. Multiplication and division is currently supported, but not conversions using sqrt or pow.
|
||||||
- Unit types
|
- Unit types
|
||||||
- Currency: How to go about dynamically updating the weights?
|
- Currency: How to go about dynamically updating the weights?
|
||||||
- Fuel consumption
|
- Fuel consumption
|
||||||
- Data transfer rate
|
- Data transfer rate
|
||||||
- Color codes
|
- Color codes
|
||||||
- Force
|
- Force
|
||||||
- Roman numerals
|
- Roman numerals
|
||||||
- Angles
|
- Angles
|
||||||
- Flow rate
|
- Flow rate
|
||||||
|
|
||||||
### Cross-compiling
|
### Cross-compiling
|
||||||
1. [Install Docker](https://docs.docker.com/get-docker/)
|
1. [Install Docker](https://docs.docker.com/get-docker/)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
use decimal_fixes_mirror::d128;
|
use decimal::d128;
|
||||||
use crate::{Token, Number};
|
use crate::{Token, Number};
|
||||||
use crate::units::{Unit, UnitType, convert, add, subtract, multiply, divide, modulo, pow};
|
use crate::units::{Unit, UnitType, convert, add, subtract, multiply, divide, modulo, pow};
|
||||||
use crate::parser::AstNode;
|
use crate::parser::AstNode;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use decimal_fixes_mirror::d128;
|
use decimal::d128;
|
||||||
use crate::{Token, TokenVector};
|
use crate::{Token, TokenVector};
|
||||||
use crate::Operator::{Caret, Divide, LeftParen, Minus, Modulo, Multiply, Plus, RightParen};
|
use crate::Operator::{Caret, Divide, LeftParen, Minus, Modulo, Multiply, Plus, RightParen};
|
||||||
use crate::UnaryOperator::{Percent, Factorial};
|
use crate::UnaryOperator::{Percent, Factorial};
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
use std::time::{Instant};
|
use std::time::{Instant};
|
||||||
use decimal_fixes_mirror::d128;
|
use decimal::d128;
|
||||||
use crate::units::Unit;
|
use crate::units::Unit;
|
||||||
|
|
||||||
/// Units, and functions you can use with them
|
/// Units, and functions you can use with them
|
||||||
@ -43,7 +43,7 @@ mod lookup;
|
|||||||
/// ```rust
|
/// ```rust
|
||||||
/// use cpc::{eval,Number};
|
/// use cpc::{eval,Number};
|
||||||
/// use cpc::units::Unit;
|
/// use cpc::units::Unit;
|
||||||
/// use decimal_fixes_mirror::d128;
|
/// use decimal::d128;
|
||||||
///
|
///
|
||||||
/// let x = Number {
|
/// let x = Number {
|
||||||
/// value: d128!(100),
|
/// value: d128!(100),
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
use crate::NamedNumber::*;
|
use crate::NamedNumber::*;
|
||||||
use crate::NamedNumber;
|
use crate::NamedNumber;
|
||||||
use decimal_fixes_mirror::d128;
|
use decimal::d128;
|
||||||
|
|
||||||
/// Returns the corresponding [`d128`] of a [`NamedNumber`]
|
/// Returns the corresponding [`d128`] of a [`NamedNumber`]
|
||||||
pub fn lookup_named_number(named_number: &NamedNumber) -> d128 {
|
pub fn lookup_named_number(named_number: &NamedNumber) -> d128 {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
use decimal_fixes_mirror::d128;
|
use decimal::d128;
|
||||||
use crate::Number;
|
use crate::Number;
|
||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq, Debug)]
|
#[derive(Clone, Copy, PartialEq, Debug)]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user