📦
Schema
  • Getting Started
  • Documents
    • Basics
      • Extend
    • Any
      • Label
      • Default
      • Required
      • Pipe
      • Validate
    • Array
      • Length
      • Max
      • Min
      • Items
    • Boolean
    • Date
      • Max
      • Min
    • Number
      • Max
      • Min
      • Multiple
      • Integer
      • Port
      • Positive
      • Precision
    • Object
      • Length
      • Max
      • Min
      • Keys
    • String
      • Alphanum
      • Credit Card
      • Email
      • Enum
      • IP Address
      • Length
      • Max
      • Min
      • Numeral
      • Regex
      • Token
  • Source Code
Powered by GitBook
On this page
  • Integer
  • Floating Point

Was this helpful?

  1. Documents
  2. Number

Integer

Check if the value is an integer or a floating-point

Integer

Checks if the given number is an integer

import Schema from "@rapidom/schema";

const Validator = Schema.number().integer();
const Validator = Schema.number().integer(true); // same result

Floating Point

Checks if the given number is a floating-point

import Schema from "@rapidom/schema";

const Validator = Schema.number().integer(false);
PreviousMultipleNextPort

Last updated 3 years ago

Was this helpful?