Revo Docs

Integer Mode

Use integer mode for whole numbers. The value is stored and displayed as an integer. You can limit the number of digits using the maxDigits parameter.

number-pad-view - Integer Mode preview
@State private var quantity: Double = 0

NumberPadView(value: $quantity, mode: .integer, maxDigits: 5)
Copied!

Price Mode

Price mode stores values as cents internally but displays them as dollars with two decimal places. Perfect for currency input.

number-pad-view - Price Mode preview
@State private var amount: Double = 0

NumberPadView(value: $amount, mode: .price)
Copied!

Decimal Mode

Decimal mode allows entering numbers with decimal points. The decimal point button is available in this mode.

number-pad-view - Decimal Mode preview
@State private var weight: Double = 0

NumberPadView(value: $weight, mode: .decimal)
Copied!

With Confirm Action

Provide a confirm closure to handle when the user taps the checkmark button. The closure receives the final value.

number-pad-view - With Confirm Action preview
@State private var tip: Double = 0

NumberPadView(
    value: $tip,
    mode: .price,
    confirm: { value in
        print("Tip entered: \(value)")
        // Handle confirmation
    }
)
Copied!