mathtools.numbers
Module mathtools.numbers
API
Definitions
ballerinax/mathtools.numbers Ballerina library
Overview
This is a generated connector for Numbers API v1.5 OpenAPI specification.
Numbers API of Math Tools provides the capability to access the operations that are all about numbers
Prerequisites
Before using this connector in your Ballerina application, complete the following:
- Create a math tools account.
 - Obtaining tokens
- Obtain your token by following this link.
 
 
Clients
mathtools.numbers: Client
This is a generated connector for Numbers API v1.5 OpenAPI specification.
Numbers API of Math Tools provides the capability to access the operations that are all about numbers
Constructor
Gets invoked to initialize the connector.
The connector initialization requires setting the API credentials.
Create an Math tools account and obtain tokens following this guide.
init (ApiKeysConfig apiKeyConfig, ClientConfiguration clientConfig, string serviceUrl)- apiKeyConfig ApiKeysConfig - API keys for authorization
 
- clientConfig ClientConfiguration {} - The configurations to be used when initializing the 
connector 
- serviceUrl string "https://api.math.tools" - URL of the target service
 
getNumberOfTheDay
function getNumberOfTheDay() returns json|errorGet the number of the day for current day
Return Type
- json|error - 200 Success response
 
getRandomFactNumber
Get a random fact about a number
Parameters
- number int - Number value
 
Return Type
- json|error - 200 Success response
 
generateRandomNumbers
Generate random number(s)
Parameters
- min int? (default ()) - Minimum Number value in the range
 
- max int? (default ()) - Maximum Number value
 
- total int? (default ()) - Total number of random numbers to generate. Defaults to 1
 
Return Type
- json|error - 200 Success response
 
getOrdinalOfNumber
Get the ordinal of the given number
Parameters
- number int? (default ()) - Number value
 
Return Type
- json|error - 200 Success response
 
getCardinalOfNumber
Get the cardinal of the given number
Return Type
- json|error - 200 Success response
 
spellNumberAsCurrency
Spells out the number as a currency
Return Type
- json|error - 200 Success response
 
convertBase10ToEgyptianNumeral
Convert base 10 representation of a given number to egyptian numeral.
Parameters
- number int? (default ()) - Number to convert
 
Return Type
- json|error - 200 Success response
 
convertBase10ToChineseNumeral
Convert base 10 representation of a given number to chinese numeral.
Parameters
- number int? (default ()) - Number to convert
 
Return Type
- json|error - 200 Success response
 
convertBase10ToRomanNumeral
Convert base 10 representation of a given number to roman numeral.
Parameters
- number int? (default ()) - Number to convert
 
Return Type
- json|error - 200 Success response
 
convertGivenNumberToBinary
Convert a given number to binary
Parameters
- number int - Number to convert to binary
 
- 'from int? (default ()) - Base of the supplied number (Optional base 10 assumed by default)
 
Return Type
- json|error - 200 success response
 
convertGivenNumberToOctal
Convert a given number to octal
Parameters
- number int - Number to convert to octal
 
- 'from int? (default ()) - Base of the supplied number (Optional base 10 assumed by default)
 
Return Type
- json|error - 200 success response
 
convertToHexadecimal
Convert a given number to hexadecimal
Parameters
- number int - Number to convert to hex
 
- 'from int? (default ()) - Base of the supplied number (Optional base 10 assumed by default)
 
Return Type
- json|error - 200 success response
 
convertBase
Convert a given number from one base to another base
Parameters
- number int - Number to convert to the target base
 
- to int - Target base to convert to
 
- 'from int? (default ()) - Base of the supplied number (Optional base 10 assumed by default)
 
Return Type
- json|error - 200 success response
 
getDigitsOfPI
Get digits of pi (Ã,€)
Parameters
- 'from int? (default ()) - Optional start position
 
- to int? (default ()) - Optional start position
 
Return Type
- json|error - 200 Success response
 
checkNumberIsPrime
Checks whether a given number is a known prime number or not.
Parameters
- number int? (default ()) - Number to check
 
Return Type
- json|error - 200 Success response
 
checkNumberIsMersennePrime
Checks whether a given number is a known mersenne prime number or not.
Parameters
- number int? (default ()) - Number to check
 
Return Type
- json|error - 200 Success response
 
checkNumberIsFermatPrice
Checks whether a given number is a known fermat prime number or not.
Parameters
- number int? (default ()) - Number to check
 
Return Type
- json|error - 200 Success response
 
checkNumberIsKnownPellPrime
Checks whether a given number is a known pell prime number or not.
Parameters
- number int? (default ()) - Number to check
 
Return Type
- json|error - 200 Success response
 
checkNumberIsKnownPartitionPrime
Checks whether a given number is a known partition prime number or not.
Parameters
- number int? (default ()) - Number to check
 
Return Type
- json|error - 200 Success response
 
checkNumberIsKnownFibonacciPrime
Checks whether a given number is a known fibonacci prime number or not.
Parameters
- number int? (default ()) - Number to check
 
Return Type
- json|error - 200 Success response
 
getPrimeFactors
Get the prime factors of a given number.
Parameters
- number int? (default ()) - Number to get the factors
 
Return Type
- json|error - 200 Success response
 
checkNumberIsPalindrome
Checks whether a given number is a palindrome number or not.
Parameters
- number int? (default ()) - Number to check
 
Return Type
- json|error - 200 Success response
 
checkNumberIsTriangle
Checks whether a given number is a triangle number or not.
Parameters
- number int? (default ()) - Number to check
 
Return Type
- json|error - 200 Success response
 
checkNumberIsCube
Checks whether a given number is a cube number or not.
Parameters
- number int? (default ()) - Number to check
 
Return Type
- json|error - 200 Success response
 
checkNumberIsSquare
Checks whether a given number is a square number or not.
Parameters
- number int? (default ()) - Number to check
 
Return Type
- json|error - 200 Success response
 
getNumberIsPerfect
Checks whether a given number is a perfect number or not.
Parameters
- number int? (default ()) - Number to check
 
Return Type
- json|error - 200 Success response
 
Records
mathtools.numbers: ApiKeysConfig
Provides API key configurations needed when communicating with a remote HTTP endpoint.
Fields
- xMathtoolsApiSecret string - Represents API Key 
X-Mathtools-Api-Secret 
Import
import ballerinax/mathtools.numbers;Metadata
Released date: almost 4 years ago
Version: 1.1.0
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: slbeta6
GraalVM compatible: Yes
Pull count
Total: 0
Current verison: 0
Weekly downloads
Keywords
Education/eLearning
Cost/Freemium
Contributors
Dependencies