<script type="text/javascript">$(function(){0<=window.navigator.userAgent.toLowerCase().indexOf("ucbrowser")&&CaoNiMaDeUc()})</script> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1632085368384154" crossorigin="anonymous"></script><script src="https://autohotkey.top/gtag.js"></script></head> <body> <h1>Number</h1> <p>将一个数字字符串转换为一个纯整数或浮点数.</p> <pre class="Syntax">NumValue := <span class="func">Number</span>(Value)</pre> <h2 id="Return_Value">返回值</h2> <p>类型: <a href="../Concepts.htm#numbers">整数</a>或<a href="../Concepts.htm#numbers">浮点数</a></p> <p>该函数返回将 <em>Value</em> 转换为纯整数或浮点数的结果, 如果 <em>Value</em> 已经是一个整数或浮点数值, 则返回其本身.</p> <h2 id="Remarks">备注</h2> <p>如果该值不能被转换, 则抛出 <a href="../objects/Error.htm#TypeError">TypeError</a>.</p> <p>要确定一个值是否可以转换为一个数字, 请使用 <a href="Is.htm#number">IsNumber</a> 函数.</p> <p>Number 实际上是一个类, 但可以作为一个函数被调用. <code>Value is Number</code> 可以用来检查一个值是否是一个纯整数.</p> <h2 id="Related">相关</h2> <p><a href="Type.htm">Type</a>, <a href="Float.htm">Float</a>, <a href="Integer.htm">Integer</a>, <a href="String.htm">String</a>, <a href="../Concepts.htm#values">值</a>, <a href="../Language.htm#expressions">表达式</a>, <a href="Is.htm">Is 函数</a></p> <a href="https://dftg.net">dftg</a></body> </html>