Add Stars/TON checks to suggestions.

This commit is contained in:
John Preston
2025-06-27 13:23:27 +04:00
parent 141fb875f9
commit c70f75b21a
13 changed files with 254 additions and 67 deletions
+9
View File
@@ -968,6 +968,15 @@ QString FormatCreditsAmountRounded(CreditsAmount amount) {
return FormatExactCountDecimal(base::SafeRound(value * 100.) / 100.);
}
QString FormatCreditsAmountWithCurrency(CreditsAmount amount) {
return (amount.ton()
? tr::lng_suggest_ton_amount
: tr::lng_prize_credits_amount)(
tr::now,
lt_count_decimal,
amount.value());
}
PluralResult Plural(
ushort keyBase,
float64 value,
+2
View File
@@ -34,6 +34,8 @@ struct ShortenedCount {
[[nodiscard]] QString FormatCreditsAmountDecimal(CreditsAmount amount);
[[nodiscard]] QString FormatCreditsAmountRounded(CreditsAmount amount);
[[nodiscard]] QString FormatCreditsAmountWithCurrency(CreditsAmount amount);
struct PluralResult {
int keyShift = 0;
QString replacement;