class DecimalException : Exception

Base exeption for this module

Example

********************************* UNITTESTS ***********************************
auto x = Decimal("36");
assert(x.value == BigInt("36000000000000000000"));
assert(x.toFullString == "36.000000000000000000");

x = Decimal("36.6");
assert(x.value == BigInt("36600000000000000000"));
assert(x.toFullString == "36.600000000000000000");

x = Decimal("36,6");
assert(x.value == BigInt("36600000000000000000"));
assert(x.toFullString == "36.600000000000000000");

x = Decimal("-36,6");
assert(x.value == BigInt("-36600000000000000000"));
assert(x.toFullString == "-36.600000000000000000");

x = Decimal(36);
assert(x.value == BigInt("36000000000000000000"));
assert(x.toFullString == "36.000000000000000000");

x = Decimal(-36);
assert(x.value == BigInt("-36000000000000000000"));
assert(x.toFullString == "-36.000000000000000000");

x = Decimal(-36.6, 4);
assert(x.value == BigInt("-366000"));
assert(x.toFullString == "-36.6000");

x = Decimal("0");
assert(x.value == BigInt("0"));
assert(x.toFullString == "0.000000000000000000");

x = Decimal(0);
assert(x.value == BigInt("0"));
assert(x.toFullString == "0.000000000000000000");

x = Decimal(0.0);
assert(x.value == BigInt("0"));
assert(x.toFullString == "0.000000000000000000");

x = Decimal(-0.0);
assert(x.value == BigInt("0"));
assert(x.toFullString == "0.000000000000000000");

x = Decimal("0.12");
assert(x.value == BigInt("120000000000000000"));
assert(x.toFullString == "0.120000000000000000");

x = Decimal(0.12);
assert(x.value == BigInt("120000000000000000"));
assert(x.toFullString == "0.120000000000000000");

x = Decimal("-0.12");
assert(x.value == BigInt("-120000000000000000"));
assert(x.toFullString == "-0.120000000000000000");

x = Decimal(-0.12);
assert(x.value == BigInt("-120000000000000000"));
assert(x.toFullString == "-0.120000000000000000");

x = Decimal("-0.02");
assert(x.value == BigInt("-20000000000000000"));
assert(x.toFullString == "-0.020000000000000000");

x = Decimal(-0.02);
assert(x.value == BigInt("-20000000000000000"));
assert(x.toFullString == "-0.020000000000000000");

x = Decimal("0.1");
assert(x.value == BigInt("100000000000000000"));
assert(x.toFullString == "0.100000000000000000");

x = Decimal(0.1);
assert(x.value == BigInt("100000000000000000"));
assert(x.toFullString == "0.100000000000000000");

x = Decimal("-0.00123");
assert(x.value == BigInt("-1230000000000000"));
assert(x.toFullString == "-0.001230000000000000");

x = Decimal(-0.00123);
assert(x.value == BigInt("-1230000000000000"));
assert(x.toFullString == "-0.001230000000000000");

x = Decimal(BigInt(36));
assert(x.value == BigInt("36000000000000000000"));
assert(x.toFullString == "36.000000000000000000");