Child pages
  • Number

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summary{th}{tr}{tbody}{tr}{td}[Number]{td}{td}[#MAX_VALUE]
The largest representable number.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#MIN_VALUE]
The smallest representable number.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#NEGATIVE_INFINITY]
Special value representing negative infinity; returned on overflow.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#NaN]
Special "not a number" value.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#POSITIVE_INFINITY]
Special value representing infinity; returned on overflow.{td}{tr}{tbody}{table}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[String]{td}{td}[#toExponential]\(\[fractionDigits\])
Returns a string representing the number in exponential notation.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#toFixed]\(\[digits\])
Returns a string representing the number in fixed\-point notation.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#toLocaleString]\()
Converts the number into a string which is suitable for presentation in the given locale.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#toPrecision]\(\[precision\])
Returns a string representing the number to a specified precision in fixed\-point or exponential notation.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#toString]\(\[radix\])
Returns a string representing the specified Number object.{td}{tr}{tbody}{table}\\ 

{table:id=property|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=MAX_VALUE|class=node}{tr:id=name}{td}h6.MAX_VALUE{td}{tr}{tr:id=des}{td}The largest representable number.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\{td}{tr}{tr:id=ret}{td}*Returns*\\ [Number]{td}{tr}{tr:id=seesam}{td}*Also seeSample*\\{div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{divcode:language=javascript}
application.output("Largest number: " + Number.MAX_VALUE);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{trtbody}{tbody:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
application.output("Largest number: " + Number.MAX_VALUE);
{code}{div}MIN_VALUE|class=node}{tr:id=name}{td}h6.MIN_VALUE{td}{tr}{tr:classid=lastDetailRowdes}{td}The smallest representable number.{td}{tr}{tbody}{tbody:id=MIN_VALUE|class=node}{tr:id=nametr:id=ret}{td}h6.MIN_VALUE*Returns*\\ [Number]{td}{tr}{tr:id=dessam}{td}The smallest representable number.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info*Sample*\\{div:class=sIndent}{code:language=javascript}
application.output("Smallest number: " + Number.MIN_VALUE);
{code}{div}{td}{tr}{tr:idclass=prslastDetailRow}{td}*Parameters*\\{td}{tr}{trtbody}{tbody:id=ret}{td}*Returns*\\[Number]NEGATIVE_INFINITY|class=node}{tr:id=name}{td}h6.NEGATIVE_INFINITY{td}{tr}{tr:id=seedes}{td}*Also see*\\{div:class=sIndent}{div}{Special value representing negative infinity; returned on overflow.{td}{tr}{tr:id=linkret}{td}*External linksReturns*\\{div:class=sIndent}{div} [Number]{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
application.output("SmallestNegative numberinfinity: " + Number.MINNEGATIVE_VALUEINFINITY);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=NEGATIVE_INFINITYNaN|class=node}{tr:id=name}{td}h6.NEGATIVE_INFINITYNaN{td}{tr}{tr:id=des}{td}Special value"not representinga negative infinity; returned on overflownumber" value.{td}{tr}{tr:id=sncret}{td}*SinceReturns*\\ Replace with version info[Object]{td}{tr}{tr:id=prssam}{td}*ParametersSample*\\{div:class=sIndent}{code:language=javascript}
application.output("NaN: " + Number.NaN);
{code}{div}{td}{tr}{tr:idclass=retlastDetailRow}{td}*Returns*\\[Number]{td}{tr}{tbody}{trtbody:id=see}{td}*Also see*\\{div:class=sIndent}{div}POSITIVE_INFINITY|class=node}{tr:id=name}{td}h6.POSITIVE_INFINITY{td}{tr}{tr:id=linkdes}{td}*External links*\\{div:class=sIndent}{div}{Special value representing infinity; returned on overflow.{td}{tr}{tr:id=samret}{td}*SampleReturns*\\ [Number]{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
application.output("NegativePositive infinity: " + Number.NEGATIVEPOSITIVE_INFINITY);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbodytable}\\ 

{table:id=NaNfunction|class=nodeservoy sDetail}{colgroup}{tr:id=namecolumn:padding=0px|width=100%}{tdcolumn}h6.NaN{tdcolgroup}{tr}{tr:id=des}{td}Special "not a number" value.{td}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=toExponential|class=node}{tr:id=sncname}{td}*Since*\\ Replace with version infoh6.toExponential{td}{tr}{tr:id=prssig}{td}*Parameters*\\{td}{tr}{tr:id=ret}{td}*Returns*\\[Object]{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{div}{{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}toExponential{span}{span:id=iets|style=float: left;}\(\[fractionDigits\]){span}{td}{tr}{tr:id=samdes}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
application.output("NaN: " + Number.NaN);
{code}{div}{Returns a string representing the number in exponential notation.{td}{tr}{tr:classid=lastDetailRowprs}{td}{td}{tr}{tbody}{tbody:id=POSITIVE_INFINITY|class=node}{tr:id=name}{td}h6.POSITIVE_INFINITY*Parameters*\\ \{[Number]} \[fractionDigits\] -- An integer specifying the number of digits after the decimal point. Defaults to as many digits as necessary to specify the number.
{td}{tr}{tr:id=ret}{td}*Returns*\\ [String] -- A string representing the number in exponential notation.{td}{tr}{tr:id=dessam}{td}Special value representing infinity; returned on overflow.*Sample*\\{div:class=sIndent}{code:language=javascript}
var n = 123.45678;
application.output(n.toExponential(3));
{code}{div}{td}{tr}{tr:idclass=snclastDetailRow}{td}*Since*\\ Replace with version info{td}{tr}{trtbody}{tbody:id=prs}{td}*Parameters*\\{td}{tr=toFixed|class=node}{tr:id=retname}{td}*Returns*\\[Number]h6.toFixed{td}{tr}{tr:id=seesig}{td}*Also see*\\{div:class=sIndent}{div{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}toFixed{span}{span:id=iets|style=float: left;}\(\[digits\]){span}{td}{tr}{tr:id=linkdes}{td}*External links*\\{div:class=sIndent}{div}Returns a string representing the number in fixed\-point notation.{td}{tr}{tr:id=samprs}{td}*SampleParameters*\\ \{div:class=sIndent}{code:language=javascript}
application.output("Positive infinity: " + Number.POSITIVE_INFINITY);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\ 

{table:id=function|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=toExponential|class=node}{tr:id=name}{td}h6.toExponential{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}toExponential{span}{span:id=iets|style=float: left;}\(\[fractionDigits\]){span}{td}{tr}{tr:id=des}{td}Returns a string representing the number in exponential notation.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\\{[Number]} \[fractionDigits\] -- An integer specifying the number of digits after the decimal point. Defaults to as many digits as necessary to specify the number.
{td}{tr}{tr:id=ret}{td}*Returns*\\[String] -- A string representing the number in exponential notation.{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var n = 123.45678;
application.output(n.toExponential(3));
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=toFixed|class=node}{tr:id=name}{td}h6.toFixed{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}toFixed{span}{span:id=iets|style=float: left;}\(\[digits\]){span}{td}{tr}{tr:id=des}{td}Returns a string representing the number in fixed\-point notation.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\\{[Number]} \[digits\] -- The number of digits to appear after the decimal point. Defaults to 0.
{td}{tr}{tr:id=ret}{td}*Returns*\\[String] -- A string representing the number in fixed-point notation.{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var n = 123.45678;
application.output(n.toFixed(3));
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=toLocaleString|class=node}{tr:id=name}{td}h6.toLocaleString{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}toLocaleString{span}{span:id=iets|style=float: left;}\(){span}[Number]} \[digits\] -- The number of digits to appear after the decimal point. Defaults to 0.
{td}{tr}{tr:id=desret}{td}Converts the number into a string which is suitable for presentation in the given locale*Returns*\\ [String] -- A string representing the number in fixed-point notation.{td}{tr}{tr:id=sncsam}{td}*SinceSample*\\ Replace with version info{div:class=sIndent}{code:language=javascript}
var n = 123.45678;
application.output(n.toFixed(3));
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=toLocaleString|class=node}{tr:id=prsname}{td}*Parameters*\\h6.toLocaleString{td}{tr}{tr:id=retsig}{td}*Returns*\\[String] -- A string representing the number in the current locale.{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{div{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}toLocaleString{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=linkdes}{td}*External links*\\{div:class=sIndent}{div}Converts the number into a string which is suitable for presentation in the given locale.{td}{tr}{tr:id=ret}{td}*Returns*\\ [String] -- A string representing the number in the current locale.{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var n = 1000000;
application.output(n.toLocaleString());
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=toPrecision|class=node}{tr:id=name}{td}h6.toPrecision{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}toPrecision{span}{span:id=iets|style=float: left;}\(\[precision\]){span}{td}{tr}{tr:id=des}{td}Returns a string representing the number to a specified precision in fixed\-point or exponential notation.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info or exponential notation.{td}{tr}{tr:id=prs}{td}*Parameters*\\ \{[Number]} \[precision\] -- An integer specifying the number of significant digits.
{td}{tr}{tr:id=ret}{td}*Returns*\\ [String] -- A string representing the number to a specified precision in fixed-point or exponential notation.{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{div}{ in fixed-point or exponential notation.{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var n = 123.45678;
application.output(n.toPrecision(5));
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=toString|class=node}{tr:id=name}{td}h6.toString{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}toString{span}{span:id=iets|style=float: left;}\(\[radix\]){span}{td}{tr}{tr:id=des}{td}Returns a string representing the specified Number object.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info.{td}{tr}{tr:id=prs}{td}*Parameters*\\ \{[Number]} \[radix\] -- An integer between 2 and 36 specifying the base to use for representing numeric values
{td}{tr}{tr:id=ret}{td}*Returns*\\[String] -- A string representing the specified Number object.{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{div} representing numeric values
{td}{tr}{tr:id=linkret}{td}*External links*\\{div:class=sIndent}{div}Returns*\\ [String] -- A string representing the specified Number object.{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var n = 7;
application.output(n.toString()); //displays "7"
application.output(n.toString(2)); //displays "111"
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}