Skip to main content

Introducing Workflow Engine, try for FREE workflowengine.io.

Number format

Introduction

Number format is a powerful input formatter that allows you to restrict and format user input to specific numeric or string patterns. This component is a part of @react-form-builder/components-rsuite.

This component is used to format the input value for display, making it easier to work with and ensuring that users can only enter text valid for your specific use case. It also offers a range of features to help you control and customize user input. These include prefix, suffix, decimal and thousands separators, scales, and more.

Additionally, the component is fully customizable, allowing you to tailor its behavior and appearance to meet your specific needs. The following introduces and describes available properties for this component.

Main properties

The following general properties are available within the Main tab:

NameTypeDescription
LabelstringProvide a name for your input field
ValuestringEnter default value for the input field
PlaceholderstringSpecify placeholder for the input field. Will not visible if a Value is provided
SizechoiceSelect the component size from extra small to large
DisabledbooleanIf set to true, disables the component
Read OnlybooleanIf set to true, makes the component unavailable for users to interact with
Allowed decimal separatorsstringSpecifies the characters that can be used as decimal separators. Defaults to "." if left empty
Allow leading zeroesbooleanIf set to true, allows the presence of leading zeroes in the input; otherwise, all leading zeroes are removed
Allow negativebooleanIf set to true, allows the input of negative values by prefixing them with a minus sign ("-"); otherwise, only positive values are allowed
Decimal scalenumberThe number of decimal places to display and accept in the input value. For example, a decimal scale of "2" would allow up to two decimal places
Decimal separatorstringSpecifies the character used to separate the integer and fractional parts of a number
Fixed decimal scalebooleanIf set to true, trailing zeroes will be added after decimal separators to match the specified decimal scale
PrefixstringPrepends given prefix character to the input value, can be used to provide measurement unit or any other prefix
SuffixstringAppends given suffix character to the input value, can be used to provide currency symbol or any other suffix
Thousands group stylechoiceSpecifies the style for grouping thousands, such as thousand (e.g., 123,456,789), indian lakh (e.g., 12,34,56,789), chinese wan (e.g., 1,2345,6789), or none (no grouping)
Thousand SeparatorstringSpecifies the character used to separate groups of thousands, such as a comma, a dot, etc.

At the bottom of the Main properties menu, you can find additional options:

Style properties

These are properties that allow to customize the size, color and other style properties of your component:

  • For Device: You can provide component's style customization for all devices or specific devices by using this dropdown list. Refer to Adaptive Layout for more details.
  • Component > Class Name: Add a class name for your component for the subsequent styling if necessary.
  • Wrapper: The options below enable you to tailor the appearance of your component and customize it for a specific device type, as selected in the For Device property:

    NameTypeDescription
    WidthnumberSpecifies the width for your component
    HeightnumberSpecifies the height for your component
    Margin top/right/bottom/leftnumberMargin values for you component
    ColorstringAllows customizing the text color
    Background colorstringEnables customizing the background color
Stay in the know
Quickly Build Drag-and-Drop Forms
Star us on GitHub