diff --git a/Sources/Scyther/Extensions/Float+Extensions.swift b/Sources/Scyther/Extensions/Float+Extensions.swift new file mode 100644 index 0000000..704c5e1 --- /dev/null +++ b/Sources/Scyther/Extensions/Float+Extensions.swift @@ -0,0 +1,15 @@ +// +// File.swift +// +// +// Created by Brandon Stillitano on 7/4/2024. +// + +import Foundation + +extension Float { + /// Returns a ``String`` representation of this value, with no decimals. + var clean: String { + return self.truncatingRemainder(dividingBy: 1) == 0 ? String(format: "%.0f", self) : String(self) + } +} diff --git a/Sources/Scyther/User Interface/Menu/MenuViewModel.swift b/Sources/Scyther/User Interface/Menu/MenuViewModel.swift index 29d56fe..c8dae9e 100644 --- a/Sources/Scyther/User Interface/Menu/MenuViewModel.swift +++ b/Sources/Scyther/User Interface/Menu/MenuViewModel.swift @@ -116,7 +116,7 @@ internal class MenuViewModel { value: UIDevice.current.modelName, icon: nil)) deviceSection.rows.append(valueRow(name: "Release Year", - value: String(UIDevice.current.generation), + value: UIDevice.current.generation.clean, icon: nil, showMenu: true)) deviceSection.rows.append(valueRow(name: "UDID", @@ -132,7 +132,7 @@ internal class MenuViewModel { icon: nil)) if let value = Bundle.main.seedId { applicationSection.rows.append(valueRow(name: "App ID Prefix", - value: Bundle.main.bundleIdentifier, + value: value, icon: nil)) } applicationSection.rows.append(valueRow(name: "Version",