mathtools.numbers
Module mathtools.numbers
API
![](https://bcentral-packageicons.azureedge.net/images/ballerinax_mathtools.numbers_1.5.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, ConnectionConfig config, string serviceUrl)
- apiKeyConfig ApiKeysConfig - API keys for authorization
- config ConnectionConfig {} - 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
mathtools.numbers: ClientHttp1Settings![](/images/permalink.svg)
Provides settings related to HTTP/1.x protocol.
Fields
- keepAlive KeepAlive(default http:KEEPALIVE_AUTO) - Specifies whether to reuse a connection for multiple requests
- chunking Chunking(default http:CHUNKING_AUTO) - The chunking behaviour of the request
- proxy ProxyConfig? - Proxy server related options
mathtools.numbers: ConnectionConfig![](/images/permalink.svg)
Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.
Fields
- httpVersion HttpVersion(default http:HTTP_2_0) - The HTTP version understood by the client
- http1Settings ClientHttp1Settings? - Configurations related to HTTP/1.x protocol
- http2Settings ClientHttp2Settings? - Configurations related to HTTP/2 protocol
- timeout decimal(default 60) - The maximum time to wait (in seconds) for a response before closing the connection
- forwarded string(default "disable") - The choice of setting
forwarded
/x-forwarded
header
- poolConfig PoolConfiguration? - Configurations associated with request pooling
- cache CacheConfig? - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding
) header
- circuitBreaker CircuitBreakerConfig? - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig RetryConfig? - Configurations associated with retrying
- responseLimits ResponseLimitConfigs? - Configurations associated with inbound response size limits
- secureSocket ClientSecureSocket? - SSL/TLS-related options
- proxy ProxyConfig? - Proxy server related options
- validation boolean(default true) - Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default
mathtools.numbers: ProxyConfig![](/images/permalink.svg)
Proxy server configurations to be used with the HTTP client endpoint.
Fields
- host string(default "") - Host name of the proxy server
- port int(default 0) - Proxy server port
- userName string(default "") - Proxy server username
- password string(default "") - Proxy server password
Import
import ballerinax/mathtools.numbers;
Metadata
Released date: over 1 year ago
Version: 1.5.0
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: 2201.4.1
GraalVM compatible: Yes
Pull count
Total: 4
Current verison: 0
Weekly downloads
Keywords
Education/eLearning
Cost/Freemium
Contributors
Dependencies