🌊
jsf
  • About KalmiaJSF
  • Setup
  • Architecture
  • Contributing
  • Changelog
  • Guides
    • Cheat Sheet
  • Examples
    • Demo example
    • Basic examples
    • Kitchen Sink example
    • Charts example
  • Schema
    • Intro to Schema
    • Prop types
      • String
      • Boolean
      • Number & Integer
      • Object
      • Array
      • Date
      • Id
      • Null
      • Ref
      • Binary
    • Prop options
      • Disabling property
      • On prop init actions
      • Persist
      • On value change
      • On user value change
    • Handlers
      • Color picker
    • Creating custom handler
      • Working with arrays
    • Value provider
  • Validation
    • Custom validation
    • Eval
  • LAYOUT
    • Intro to Layout
    • Layout options
      • Show & hide
      • On click action
  • INTERFACES
    • Value Options
  • Form
    • Form data
  • OTHER
    • Events
    • Lifecycle hooks
    • Notifications support
  • PAGES & COMPONENTS
    • Page
    • Component
  • THEMING
    • Creating new theme variant
  • BUILDER
    • Shortcuts
  • Help
    • FAQ
Powered by GitBook
On this page
  • Options
  • Options for only number type
  • Options for only number type
  • Examples

Was this helpful?

Export as PDF
  1. Schema
  2. Prop types

Number & Integer

Represents JS primitive type number.

{
    "type": "number"
}

Represents integer type. Since JS doesn't have integer it's represented as JS primitive type number.

{
    "type": "integer"
}

Options

minimum

The value of "minimum" MUST be a number, representing an inclusive lower limit for a numeric instance. If the instance is a number, then this keyword validates only if the instance is greater than or exactly equal to "minimum".

maximum

The value of "maximum" MUST be a number, representing an inclusive upper limit for a numeric instance. If the instance is a number, then this keyword validates only if the instance is less than or exactly equal to "maximum".

Options for only number type

even

The value of "even" MUST be a boolean, representing the number must be even.

odd

The value of "odd" MUST be a boolean, representing the number must be odd.

Options for only number type

exclusiveMinimum

The value of "exclusiveMinimum" MUST be number, representing an exclusive lower limit for a numeric instance. If the instance is a number, then the instance is valid only if it has a value strictly greater than (not equal to) "exclusiveMinimum".

exclusiveMaximum

The value of "exclusiveMaximum" MUST be number, representing an exclusive upper limit for a numeric instance. If the instance is a number, then the instance is valid only if it has a value strictly less than (not equal to) "exclusiveMaximum".

minDecimalDigits

The minimum number of digits after the decimal point. Default is 0.

maxDecimalDigits

The maximum number of digits after the decimal point. Default is unlimited. Note: JS uses float so you do not have unlimited fractions.

Examples

{
    'type'            : 'number',
    'required'        : true,
    'default'         : 1,
    'minDecimalDigits': 3,
    'maxDecimalDigits': 3,
}
PreviousBooleanNextObject

Last updated 4 years ago

Was this helpful?