Mercurial > public > simoleon
comparison Simoleon/Helpers/ConversionBox.swift @ 120:cd801949925b
Remove 1000 from default currency conversion
author | Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com> |
---|---|
date | Sun, 15 Aug 2021 11:10:39 +0100 |
parents | 75c1a05176f6 |
children | 1fd9e27df5be |
comparison
equal
deleted
inserted
replaced
119:f9d8b3c6597f | 120:cd801949925b |
---|---|
38 } | 38 } |
39 } | 39 } |
40 .keyboardType(.decimalPad) | 40 .keyboardType(.decimalPad) |
41 .font(Font.title.weight(.semibold)) | 41 .font(Font.title.weight(.semibold)) |
42 .lineLimit(1) | 42 .lineLimit(1) |
43 .padding(.bottom, 10) | |
44 } | 43 } |
45 | 44 |
46 Divider() | 45 Divider() |
47 | 46 |
48 Text("\(currencyMetadata[String(currencies[1])]!.name) (\(String(currencies[1])))") | 47 Text("\(currencyMetadata[String(currencies[1])]!.name) (\(String(currencies[1])))") |
66 if the amount can be converted to Double: | 65 if the amount can be converted to Double: |
67 * Return amount | 66 * Return amount |
68 else: | 67 else: |
69 * Return zero | 68 * Return zero |
70 */ | 69 */ |
71 private func makeConversion() -> Double { | 70 func makeConversion() -> Double { |
72 if let amountToConvert = Double(amountToConvert) { | 71 if let amountToConvert = Double(amountToConvert) { |
73 return amountToConvert * price // Conversion | 72 return amountToConvert * price // Conversion |
74 } else { | 73 } else { |
75 return 0 | 74 return 0 |
76 } | 75 } |