Skip to content

Commit

Permalink
CLDescriptiveNumber now accepts Int number instead of String number
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangerhards committed Jan 13, 2022
1 parent c02fcc5 commit ba883f9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/CleanUI/Views/Texts/CLDescriptiveNumber.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@ public struct CLDescriptiveNumber: View {
case normal, small
}

var number: String
var number: Int
var description: String
var size: CLDescriptiveNumber.Size

/// - Parameters:
/// - number: The number which will be described
/// - description: The description for the number
/// - size: The size, default is `.normal
public init(_ number: String, description: String, size: CLDescriptiveNumber.Size = .normal) {
public init(_ number: Int, description: String, size: CLDescriptiveNumber.Size = .normal) {
self.number = number
self.description = description
self.size = size
}

public var body: some View {
VStack {
Text(Int(number)!.abbreviate())
Text(number.abbreviate())
.font(size == .small ? .subheadline : .body)
.fontWeight(.bold)

Expand Down

0 comments on commit ba883f9

Please sign in to comment.