max / makenotwork
1 file changed,
+4 insertions,
-2 deletions
| @@ -423,8 +423,10 @@ fn item_price_label(item: &db::DbItem) -> String { | |||
| 423 | 423 | } | |
| 424 | 424 | ||
| 425 | 425 | fn dollars(cents: i32) -> String { | |
| 426 | - | let cents = cents.max(0); | |
| 427 | - | format!("${}.{:02}", cents / 100, cents % 100) | |
| 426 | + | // Route through the canonical formatter so the cents→dollars arithmetic has a | |
| 427 | + | // single source of truth (Run 9). Clamp negatives to 0 — custom pages never | |
| 428 | + | // show a negative price. | |
| 429 | + | format!("${}", crate::formatting::format_dollars_plain(cents.max(0))) | |
| 428 | 430 | } | |
| 429 | 431 | ||
| 430 | 432 | /// Bare hostname from the Host header, lowercased, port stripped. |