Digital ACT-191 ONEAPP-9314 story: added missed comments
This commit is contained in:
parent
1bd58256f7
commit
e5d9f77d3d
@ -153,6 +153,7 @@ open class PriceLockup: View {
|
||||
//--------------------------------------------------
|
||||
internal var containerSize: CGSize { CGSize(width: 45, height: 44) }
|
||||
|
||||
// TextStyle for the size.
|
||||
private var textStyle: TextStyle.StandardStyle {
|
||||
switch (size, textPosition) {
|
||||
case (.xxxsmall, .preDelimiter), (.xxxsmall, .postDelimiter):
|
||||
@ -228,6 +229,7 @@ open class PriceLockup: View {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Private Methods
|
||||
//--------------------------------------------------
|
||||
// Update PriceLockup text attributes
|
||||
func updateLabelAttributes() {
|
||||
var attributes: [any LabelAttributeModel] = []
|
||||
attributes.append(ColorLabelAttribute(location: 0,
|
||||
@ -242,6 +244,7 @@ open class PriceLockup: View {
|
||||
textStyle: bold ? textStyle.bold : textStyle.regular,
|
||||
textPosition: .left))
|
||||
attributes.append(StrikeThroughLabelAttribute(location:strikethroughLocation, length: strikethroughLength))
|
||||
|
||||
} else if uniformSize {
|
||||
|
||||
// currency and value have the same font text style as delimeter, term, trailing text and superscript.
|
||||
@ -249,6 +252,7 @@ open class PriceLockup: View {
|
||||
length: priceLockupLabel.text.count,
|
||||
textStyle: bold ? textStyle.bold : textStyle.regular,
|
||||
textPosition: .left))
|
||||
|
||||
} else {
|
||||
|
||||
// size updates relative to predelimiter, postdelimiter
|
||||
@ -269,6 +273,7 @@ open class PriceLockup: View {
|
||||
priceLockupLabel.attributes = attributes
|
||||
}
|
||||
|
||||
// Get text for PriceLockup.
|
||||
open func fetchText() -> String {
|
||||
var text : String = ""
|
||||
let space = " "
|
||||
@ -302,6 +307,6 @@ open class PriceLockup: View {
|
||||
extension Float {
|
||||
// remove a decimal from a float if the decimal is equal to 0
|
||||
var clean: String {
|
||||
return self.truncatingRemainder(dividingBy: 1) == 0 ? String(format: "%.0f", self) : String(self)
|
||||
return self.truncatingRemainder(dividingBy: 1) == 0 ? String(format: "%.0f", self) : String(self)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user