num_to_speech: Convert Numbers to English

Description Usage Arguments Value Note Author(s) Examples

Description

This function converts numbers to English in how people actually speak it instead of converting it digit by digit. It currents supports integers between 0 and 99999 and decimals between 0 and 1 with up to ten digits.

Usage

1
num_to_speech(number, zero.digit=F, round.digit=3, zero.append=F)

Arguments

number

A vector of numbers.

zero.digits

A logical vector indicating whether the zero before the decimal point should be pronunced.

round.digit

A numeric vector indicating how many digits after the decimal point to round.

zero.append

A logical vector indicating whether zeroes will be appended if the round.digit is larger than the actual number of digits after the decimal point.

Value

A vector of numbers in English

Note

Since this function attempts to replicate how humans actually say the numbers instead of saying all the digits, it now only supports a limited range of numbers.

Author(s)

Kevin Wang

Examples

1
num_to_speech(c(100, 296, 0.1), T, 1, F)

kevin931/MeterOMeter documentation built on Jan. 5, 2021, 12:12 p.m.