Numbers
This page defines the supported base number types available from the Mockd API.
Integers
int - A random whole number from 0-999,999,999.
int-const - Returns the number provided in the "value" field. Useful if you want a consistent number. Returns 0 if there
was a problem with the value entered.
{
"fields": {
"constantNum": "int-const-[37]"
}
}
{ "constantNum": 37 }
Upper Bounds
int-1 - A random whole number from 0-9.
int-2 - A random whole number from 0-99.
int-3 - A random whole number from 0-999.
int-4 - A random whole number from 0-9,999.
int-5 - A random whole number from 0-99,999.
int-6 - A random whole number from 0-999,999.
int-7 - A random whole number from 0-9,999,999.
int-8 - A random whole number from 0-99,999,999.
int-9 - A random whole number from 0-999,999,999.
int-10 - A random whole number from 0-9,999,999,999.
Note: int-10 is technically a long because it exceeds the upper bounds of an integer.
Fixed Length
int-fixed-1 - A random whole number from 0-9.
int-fixed-2 - A random whole number from 10-99.
int-fixed-3 - A random whole number from 100-999.
int-fixed-4 - A random whole number from 1000-9999.
int-fixed-5 - A random whole number from 10,000-99,999.
int-fixed-6 - A random whole number from 100,000-999,999.
int-fixed-7 - A random whole number from 1,000,000-9,999,999.
int-fixed-8 - A random whole number from 10,000,000-99,999,999.
int-fixed-9 - A random whole number from 100,000,000-999,999,999.
int-fixed-10 - A random whole number from 1,000,000,000-9,999,999,999.
Note: int-fixed-10 is technically a long because it exceeds the upper bounds of an integer.
Floating Point
The Mockd API has the ability to generate a random floating point number.
float - A random decimal value from 0.0-1.0.
Currency
The Mockd API supports generating a random decimal value with 2 decimal places to represent a monetary value.
money - A random monetary value from 0.00-999,999,999.99.
money-1 - A random monetary value from 0.00-9.99.
money-2 - A random monetary value from 0.00-99.99.
money-3 - A random monetary value from 0.00-999.99.
money-4 - A random monetary value from 0.00-9,999.99.
money-5 - A random monetary value from 0.00-99,999.99.
money-6 - A random monetary value from 0.00-999,999.99.
money-7 - A random monetary value from 0.00-9,999,999.99.
money-8 - A random monetary value from 0.00-99,999,999.99.
money-9 - A random monetary value from 0.00-999,999,999.99.
Prepend the dollar sign to any of the above types if you need the currency value formatted as a string with the USD currency symbol $.