ocpi-tariffs 0.43.0

OCPI tariff calculations
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use rust_decimal_macros::dec;

use super::RoundDecimal;

#[test]
fn should_round_to_nearest_even_below() {
    let d = dec!(13.951148000000);
    assert_eq!(d.round_to_ocpi_scale(), dec!(13.9511));
}

#[test]
fn should_round_to_nearest_even_above() {
    let d = dec!(13.951158000000);
    assert_eq!(d.round_to_ocpi_scale(), dec!(13.9512));
}