FakeMyJSON
  • FakeMyJSON - Documentation
  • Faker Formatters
    • Base
    • Lorem Ipsum Text
    • Person
    • Address
    • Phone Number
    • Company
    • Real Text
    • Date and Time
    • Internet
    • User Agent
    • Payment
    • Color
    • File
    • Image
    • Uuid
    • Barcode
    • Miscellaneous
  • Special Keys and Values
    • Special Keys
  • FakeMyJSON.io
  • Start generating random JSON!
Powered by GitBook
On this page
  • randomDigit
  • randomDigitNot(digit)
  • randomDigitNotNull
  • randomDigit(numberOfDigits, strict)
  • randomFloat(maxDecimals, min, max)
  • numberBetween(min, max)
  • randomLetter
  • randomElement(elements)
  • randomElements(elements, count)

Was this helpful?

  1. Faker Formatters

Base

randomDigit

Output Type: Integer

{
    "hierarchy": "randomDigit"
}
{
    "hierarchy": 7
}

randomDigitNot(digit)

Output Type: Integer

Argument

Type

Default

Valid Values

digit

Integer

NULL

0,1,2,3,4,5,6,7,8,9

{
    "hierarchy": "randomDigitNot(5)"
}
{
    "hierarchy": 7
}

randomDigitNotNull

Output Type: Integer

{
    "hierarchy": "randomDigitNotNull"
}
{
    "hierarchy": 5
}

randomDigit(numberOfDigits, strict)

Output Type: Integer

Argument

Type

Default

Valid Values

numberOfDigits

Integer

NULL

eg. 0,1,2,3,4,5,6,7,8,9

strict

Boolean

false

true, false

{
    "amount": "randomNumber(3)"
}
{
    "amount": 144
}

randomFloat(maxDecimals, min, max)

Output Type: Integer

Argument

Type

Default

Valid Values

maxDecimals

Integer

NULL

eg. 0,1,2,3,4,5,6,7,8,9

min

Integer

0

max

Integer

NULL

{
    "temperature": "randomFloat(1, -30, 50)"
}
{
    "temperature": 24.5
}

numberBetween(min, max)

Output Type: Integer

Argument

Type

Default

Valid Values

min

Integer

0

max

Integer

NULL

{
"age": "numberBetween(0, 100)"
}
{
    "age": 64
}

randomLetter

Output Type: String

{
    "type": "randomLetter"
}
{
    "type": "b"
}

randomElement(elements)

Output Type: String

Argument

Type

Default

Valid Values

elements

Array

NULL

array ('a','b','c')

{
    "category": "randomElements(['Smartphone', 'Tablet'])"
}
{
    "category": "Tablet"
}

randomElements(elements, count)

Output Type: Array

Argument

Type

Default

Valid Values

elements

Array

NULL

array ('a','b','c')

count

Integer

1

eg. 0,1,2,3,4,5,6,7,8,9

{
    "category": "randomElements(['Smartphone', 'Tablet'])",
    "tags": "randomElements(['computing', 'healthcare', 'education', 'banking'], 2)"
}
{
    "category": [
        "Tablet"
    ],
    "tags": [
        "computing",
        "banking"
    ]
}

PreviousFakeMyJSON - DocumentationNextLorem Ipsum Text

Last updated 4 years ago

Was this helpful?