computer: stateful: maybe got rollback to work, tbd

This commit is contained in:
nym21
2025-08-19 23:34:05 +02:00
parent 05036c682f
commit da1ff2cacc
20 changed files with 267 additions and 139 deletions

View File

@@ -39,8 +39,12 @@ impl Dollars {
Dollars((self.0 * 100.0).round() / 100.0)
}
pub fn round_to_4_digits(self) -> Self {
Self::from(Cents::from(self).round_to_4_digits())
pub fn round_to(self, digits: i32) -> Self {
Self::from(Cents::from(self).round_to(digits))
}
pub fn is_negative(&self) -> bool {
self.0 < 0.0
}
}