EVOLUTION-MANAGER
Edit File: numbers_to_words.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Convert numbers to English words</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for numbers_to_words {xfun}"><tr><td>numbers_to_words {xfun}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Convert numbers to English words</h2> <h3>Description</h3> <p>This can be helpful when writing reports with <span class="pkg">knitr</span>/<span class="pkg">rmarkdown</span> if we want to print numbers as English words in the output. The function <code>n2w()</code> is an alias of <code>numbers_to_words()</code>. </p> <h3>Usage</h3> <pre> numbers_to_words(x, cap = FALSE, hyphen = TRUE, and = FALSE) n2w(x, cap = FALSE, hyphen = TRUE, and = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>A numeric vector. Values should be integers. The absolute values should be less than <code>1e15</code>.</p> </td></tr> <tr valign="top"><td><code>cap</code></td> <td> <p>Whether to capitalize the first letter of the word. This can be useful when the word is at the beginning of a sentence. Default is <code>FALSE</code>.</p> </td></tr> <tr valign="top"><td><code>hyphen</code></td> <td> <p>Whether to insert hyphen (-) when the number is between 21 and 99 (except 30, 40, etc.).</p> </td></tr> <tr valign="top"><td><code>and</code></td> <td> <p>Whether to insert <code>and</code> between hundreds and tens, e.g., write 110 as “one hundred and ten” if <code>TRUE</code> instead of “one hundred ten”.</p> </td></tr> </table> <h3>Value</h3> <p>A character vector. </p> <h3>Author(s)</h3> <p>Daijiang Li </p> <h3>Examples</h3> <pre> library(xfun) n2w(0, cap = TRUE) n2w(0:121, and = TRUE) n2w(1e+06) n2w(1e+11 + 12345678) n2w(-987654321) n2w(1e+15 - 1) </pre> <hr /><div style="text-align: center;">[Package <em>xfun</em> version 0.16 <a href="00Index.html">Index</a>]</div> </body></html>