1. Go to this page and download the library: Download aichadigital/lara100 library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
aichadigital / lara100 example snippets
0.1 + 0.2 === 0.3; // false — result is 0.30000000000000004
use AichaDigital\Lara100\ValueObjects\FixedDecimal;
// From the raw stored integer (no conversion, no rounding — the cleanest path)
$price = FixedDecimal::ofUnscaled(1999, 2); // 19.99
$rate = FixedDecimal::ofUnscaled(12345, 4); // 1.2345
// From a decimal string (parse and optionally coerce to a target scale)
$price = FixedDecimal::ofDecimalString('19.99'); // scale inferred from the string's decimals (here, 2)
$price = FixedDecimal::ofDecimalString('19.9', 2); // coerced to scale 2 → '19.90'
// Zero at a given scale
$zero = FixedDecimal::zero(2); // 0.00
use AichaDigital\Lara100\RoundingMode;
// From a float — reintroduces IEEE-754 at the boundary; use only when crossing
// a legacy float API or when receiving user input that cannot be treated as a string
$price = FixedDecimal::ofFloat(19.99, 2, RoundingMode::HalfUp);