feat: compute total price for bill #108

Merged
realaravinth merged 5 commits from billing into master 2024-09-18 17:27:22 +05:30
Showing only changes of commit d4acccde9d - Show all commits

View file

@ -53,7 +53,12 @@ impl Price {
pub fn from_minor(minor_only: usize, currency: Currency) -> Price {
let minor = minor_only % 100;
let major = (minor_only - minor) / 100;
let major_only = minor_only - minor;
let major = if major_only == 0 {
0
} else {
(minor_only - minor) / 100
};
Price {
minor,
major,