mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Fixed currency formatting for channel earn info section.
This commit is contained in:
@@ -48,8 +48,11 @@ QString MinorPart(EarnInt value) {
|
||||
|
||||
QString ToUsd(EarnInt value, float64 rate) {
|
||||
constexpr auto kApproximately = QChar(0x2248);
|
||||
const auto multiplier = EarnInt(rate * Data::kEarnMultiplier);
|
||||
const auto result = (value * multiplier) / Data::kEarnMultiplier;
|
||||
|
||||
const auto result = value
|
||||
/ float64(Data::kEarnMultiplier)
|
||||
* rate
|
||||
* Data::kEarnMultiplier;
|
||||
return QString(kApproximately)
|
||||
+ QChar('$')
|
||||
+ MajorPart(result)
|
||||
|
||||
Reference in New Issue
Block a user