mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Various fixes
This commit is contained in:
parent
ec074f650d
commit
9ba7e6e735
11 changed files with 211 additions and 70 deletions
|
|
@ -153,10 +153,9 @@ class BarsComponentController: GeneralChartComponentController {
|
|||
func verticalLimitsLabels(verticalRange: ClosedRange<CGFloat>, secondary: Bool) -> (ClosedRange<CGFloat>, [LinesChartLabel]) {
|
||||
var (range, labels) = super.verticalLimitsLabels(verticalRange: verticalRange)
|
||||
if secondary {
|
||||
let allowedChars = "0123456789\(self.verticalLimitsNumberFormatter.decimalSeparator ?? ".")"
|
||||
var updatedLabels: [LinesChartLabel] = []
|
||||
for label in labels {
|
||||
let convertedValue = (Double(label.text.filter(allowedChars.contains)) ?? 0.0) * self.conversionRate
|
||||
let convertedValue = (self.verticalLimitsNumberFormatter.number(from: label.text) as? Double ?? 0.0) * self.conversionRate
|
||||
let text: String
|
||||
if convertedValue > 1.0 {
|
||||
text = String(format: "%0.1f", convertedValue)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue