mathtools.numbers
Module mathtools.numbers
API
Definitions
![](https://bcentral-packageicons.azureedge.net/images/ballerinax_mathtools.numbers_1.2.0.png)
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![](/images/permalink.svg)
mathtools.numbers: Client![](/images/permalink.svg)
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![](/images/permalink.svg)
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![](/images/permalink.svg)
function getNumberOfTheDay() returns json|error
Get the number of the day for current day
Return Type
- json|error - 200 Success response
getRandomFactNumber![](/images/permalink.svg)
Get a random fact about a number
Parameters
- number int - Number value
Return Type
- json|error - 200 Success response
generateRandomNumbers![](/images/permalink.svg)
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![](/images/permalink.svg)
Get the ordinal of the given number
Parameters
- number int? (default ()) - Number value
Return Type
- json|error - 200 Success response
getCardinalOfNumber![](/images/permalink.svg)
Get the cardinal of the given number
Return Type
- json|error - 200 Success response
spellNumberAsCurrency![](/images/permalink.svg)
Spells out the number as a currency
Return Type
- json|error - 200 Success response
convertBase10ToEgyptianNumeral![](/images/permalink.svg)
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![](/images/permalink.svg)
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![](/images/permalink.svg)
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![](/images/permalink.svg)
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![](/images/permalink.svg)
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![](/images/permalink.svg)
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![](/images/permalink.svg)
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![](/images/permalink.svg)
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![](/images/permalink.svg)
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![](/images/permalink.svg)
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![](/images/permalink.svg)
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![](/images/permalink.svg)
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![](/images/permalink.svg)
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![](/images/permalink.svg)
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![](/images/permalink.svg)
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![](/images/permalink.svg)
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![](/images/permalink.svg)
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![](/images/permalink.svg)
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![](/images/permalink.svg)
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![](/images/permalink.svg)
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![](/images/permalink.svg)
mathtools.numbers: ApiKeysConfig![](/images/permalink.svg)
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: over 2 years ago
Version: 1.2.0
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: 2201.0.0
GraalVM compatible: Yes
Pull count
Total: 4
Current verison: 1
Weekly downloads
Keywords
Education/eLearning
Cost/Freemium
Contributors
Dependencies