Skip to content

Commit

Permalink
Switch back to official decimal
Browse files Browse the repository at this point in the history
Switch back to official `decimal` because alkis/decimal#59 is fixed
  • Loading branch information
probablykasper committed Mar 14, 2021
1 parent 065adb3 commit 1db9598
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 21 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ keywords = ["math", "expression", "evaluate", "units", "convert"]
categories = ["mathematics", "science", "parsing", "text-processing", "value-formatting"]

[dependencies]
# decimal = "2.0.4"
decimal_fixes_mirror = "2.0.4-fix1.0.0"
decimal = "2.1.0"
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 }`.


[![Crates.io](https://img.shields.io/crates/v/cpc.svg)](https://crates.io/crates/cpc)
[![Documentation](https://docs.rs/cpc/badge.svg)](https://docs.rs/cpc)

Expand Down Expand Up @@ -171,14 +170,14 @@ match string {
### Potential Improvements
- Support for conversion between Power, Current, Resistance and Voltage. Multiplication and division is currently supported, but not conversions using sqrt or pow.
- Unit types
- Currency: How to go about dynamically updating the weights?
- Fuel consumption
- Data transfer rate
- Color codes
- Force
- Roman numerals
- Angles
- Flow rate
- Currency: How to go about dynamically updating the weights?
- Fuel consumption
- Data transfer rate
- Color codes
- Force
- Roman numerals
- Angles
- Flow rate

### Cross-compiling
1. [Install Docker](https://docs.docker.com/get-docker/)
Expand Down
2 changes: 1 addition & 1 deletion src/evaluator.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use decimal_fixes_mirror::d128;
use decimal::d128;
use crate::{Token, Number};
use crate::units::{Unit, UnitType, convert, add, subtract, multiply, divide, modulo, pow};
use crate::parser::AstNode;
Expand Down
2 changes: 1 addition & 1 deletion src/lexer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::str::FromStr;
use decimal_fixes_mirror::d128;
use decimal::d128;
use crate::{Token, TokenVector};
use crate::Operator::{Caret, Divide, LeftParen, Minus, Modulo, Multiply, Plus, RightParen};
use crate::UnaryOperator::{Percent, Factorial};
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
//! ```
use std::time::{Instant};
use decimal_fixes_mirror::d128;
use decimal::d128;
use crate::units::Unit;

/// Units, and functions you can use with them
Expand All @@ -43,7 +43,7 @@ mod lookup;
/// ```rust
/// use cpc::{eval,Number};
/// use cpc::units::Unit;
/// use decimal_fixes_mirror::d128;
/// use decimal::d128;
///
/// let x = Number {
/// value: d128!(100),
Expand Down
2 changes: 1 addition & 1 deletion src/lookup.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::NamedNumber::*;
use crate::NamedNumber;
use decimal_fixes_mirror::d128;
use decimal::d128;

/// Returns the corresponding [`d128`] of a [`NamedNumber`]
pub fn lookup_named_number(named_number: &NamedNumber) -> d128 {
Expand Down
2 changes: 1 addition & 1 deletion src/units.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use decimal_fixes_mirror::d128;
use decimal::d128;
use crate::Number;

#[derive(Clone, Copy, PartialEq, Debug)]
Expand Down

0 comments on commit 1db9598

Please sign in to comment.