<html><head><title>StrD</title></head><body bgcolor="#FFFFFF" link="#207BC3" vlink="#003B83" alink="#003B83"><font face="Arial" size="2"><p align="center"><b><font size="4">StrD()</font></b></p><p><b>Syntax</b></p><blockquote>Result$ = <font color="#207BC3"><b>StrD</b></font>(Value.d [, NbDecimal])</blockquote></blockquote><b>Description</b><br><blockquote>Converts a double number into a string.</blockquote><p><b>Parameters</b></p><blockquote><style type="text/css">table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }</style><table width="90%" class="parameters"><tr><td width="10%"><i>Value.d</i></td><td width="90%">The value to convert.</td></tr><tr><td><i>NbDecimal (optional)</i></td><td>The maximum number of decimal places for the converted number. If omitted, it will be set to 10 decimal places, with removing the trailing zeros.The number will be rounded, if 'NbDecimal' is smaller than existing decimal places of 'Value.d'.</td></tr></table></blockquote><p><b>Return value</b></p><blockquote>A string holding the converted value.</blockquote><p><b>Remarks</b></p><blockquote>Signed integer numbers have to be converted with <a href="str.html">Str()</a> and unsigned numbers with <a href="stru.html">StrU()</a>.It is possible to omit this command when concatenating string and double, it will then use the default behaviour of <a href="strd.html">StrD()</a>.</blockquote><p><b>Example</b></p><blockquote><pre><font face="Courier New, Courier, mono"size="2"> Value.d = 10.54<b><font color="#207BC3">Debug</font></b> "Result: " +<font color="#207BC3"> StrD</font>(Value) <font color="#207BC3">; we do not use the 2nd parameter, so we get a float number rounded to 10 decimal places</font><b><font color="#207BC3">Debug</font></b> "Result: " + Value <font color="#207BC3">; same as previous line</font><b><font color="#207BC3">Debug</font></b> "Result: " +<font color="#207BC3"> StrD</font>(Value, 2) <font color="#207BC3">; we want a result with two decimal places, no rounding needed as we have only two</font><b><font color="#207BC3">Debug</font></b> "Result: " +<font color="#207BC3"> StrD</font>(Value, 0) <font color="#207BC3">; we want a result with no decimal places, so the value is rounded</font></font></pre></blockquote><p><b>See Also</b></p><blockquote><a href="strf.html">StrF()</a>, <a href="str.html">Str()</a>, <a href="stru.html">StrU()</a></Blockquote><center><- <a href=str.html>Str()</a> - <a href="index.html">String Index</a> - <a href="strf.html">StrF()</a> -><br><br></body></html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。