Upgrade Guide

From 2.0 to 2.1

No changes are required for normal existing usage. Existing valid integer, float, money, month, batch, and fluent calls remain available.

Update the dependency as usual:

composer require rakibhstu/number-to-bangla:^2.1

New APIs

Version 2.1 adds:

$number->bnDate('2024-01-15');
$number->bnWeekNumber('2024-01-15');
$number->bnCurrency('1500.25', 'রুপি', 'পয়সা');
$number->bnOrdinal(1);

Behavior improvements in 2.1

Validation changes

Inputs such as 1e3, 1E3, abc, booleans, and malformed decimal strings are now rejected with InvalidNumber.

Invalid times such as 25:61 throw InvalidTime. Invalid dates and unsupported bnDate() formats throw InvalidDate.

If an application previously relied on malformed values being silently accepted, normalize those values before passing them to the package.

Compatibility notes