<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>toString( ) Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/tostring/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/tostring/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Wed, 13 Apr 2022 16:30:46 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>How to use Number Methods in JavaScript?</title>
		<link>https://www.scmgalaxy.com/tutorials/how-to-use-number-methods-in-javascript/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-to-use-number-methods-in-javascript/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Thu, 05 Aug 2021 11:38:40 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Methods in JavaScript]]></category>
		<category><![CDATA[toString( )]]></category>
		<category><![CDATA[Variable]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7442</guid>

					<description><![CDATA[<p>Number Methods toString ( ) toExponential ( ) toFixed ( ) toPrecision ( ) valueOf( ) isFinite( ) isInteger( ) [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-use-number-methods-in-javascript/">How to use Number Methods in JavaScript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Number Methods</h2>



<ul class="wp-block-list"><li><strong>toString ( )</strong></li><li><strong>toExponential ( )</strong></li><li><strong>toFixed ( )</strong></li><li><strong>toPrecision ( )</strong></li><li><strong>valueOf( )</strong></li><li><strong>isFinite( )</strong></li><li><strong>isInteger( )</strong></li><li><strong>isNan( )</strong></li><li><strong>isSafeInteger( )</strong></li></ul>



<h2 class="wp-block-heading">toString( )</h2>



<p class="wp-block-paragraph">toString ( ) method returns a number as a string in other words it converts a number into a string. We can use this method to output numbers as hexadecimal (16), octal(8), binary(2).</p>



<p class="wp-block-paragraph"><strong>Syntax: &#8211;<br>Variable_name.toString( );</strong></p>



<script src="https://gist.github.com/vijaypk376/f1fc0a684e12220197b9ce3abcc7cc69.js"></script>



<h2 class="wp-block-heading">toExponential ( )</h2>



<p class="wp-block-paragraph">The toExponential() method converts a number into an exponential notation.</p>



<p class="wp-block-paragraph">Syntax:-<br>Variable_name.toExponential(y)<br>Where y is an integer between 0 and 20 representing the number of digits in the<br>notation after the decimal point. If omitted, it is set to as many digits as necessary to<br>represent the value.</p>



<p class="wp-block-paragraph"><strong>Ex: &#8211;</strong></p>



<script src="https://gist.github.com/vijaypk376/690db0ff3ba7194c2770fd51dfd354eb.js"></script>



<h2 class="wp-block-heading">toFixed ( )</h2>



<p class="wp-block-paragraph">The toFixed() method converts a number into a string, keeping a specified number of decimals also rounds the decimal. If the desired number of decimals is higher than the actual number, nulls are added to create the desired decimal length.</p>



<p class="wp-block-paragraph">Syntax: &#8211;<br>a.toFixed(y)<br>Where y is the number of digits after the decimal point. Default is 0 (no digits after the decimal point)</p>



<p class="wp-block-paragraph">Syntax: &#8211;<br>a.toFixed(y)<br>Where y is the number of digits after the decimal point. Default is 0 (no digits after the decimal point)</p>



<p class="wp-block-paragraph">Ex:-</p>



<script src="https://gist.github.com/vijaypk376/75571b15d69e97a04ddbf28799af5dae.js"></script>



<h2 class="wp-block-heading">toPrecision ( )</h2>



<p class="wp-block-paragraph">The toPrecision() method formats a number to a specified length.<br>A decimal point and nulls are added (if needed), to create the specified length.</p>



<p class="wp-block-paragraph">Syntax:-<br>Variable_name.toPrecision(y)<br>Where y is the number of digits. If omitted, it returns the entire number (without any<br>formatting)</p>



<p class="wp-block-paragraph">Syntax:-<br>Variable_name.toPrecision(y)<br>Where y is the number of digits. If omitted, it returns the entire number (without any<br>formatting)</p>



<p class="wp-block-paragraph">Ex:-</p>



<script src="https://gist.github.com/vijaypk376/e35753fc561a64f68f1d93ab8b86e882.js"></script>



<h2 class="wp-block-heading">Number.isNaN()</h2>



<p class="wp-block-paragraph">The <strong>Number.isNaN() </strong>method determines whether a value is NaN (Not-A-Number).<br>This method returns true if the value is of the type Number, and equates to NaN. Otherwise, it returns false.<br>Number.isNaN() is different from the global isNaN() function. The global isNaN() function<br>converts the tested value to a Number, then tests it.<br>Number.isNaN() does not convert the values to a Number, and will not return true for any value<br>that is not of the type Number.</p>



<script src="https://gist.github.com/vijaypk376/16f8fc3f9eba2e7e18df23951e82f852.js"></script>



<h2 class="wp-block-heading">Number.isInteger( )</h2>



<p class="wp-block-paragraph">The Number.isInteger() method determines whether a value is an integer.<br>This method returns true if the value is of the type Number, and an integer, otherwise it<br>returns false.</p>



<p class="wp-block-paragraph"><strong>Ex: &#8211;</strong></p>



<script src="https://gist.github.com/vijaypk376/ad493b00cbc323e47e0f38adf4143e5d.js"></script>



<h2 class="wp-block-heading">Number.isSafeInteger()</h2>



<p class="wp-block-paragraph">The Number.isSafeInteger() method determines whether a value is a safe integer.<br>A safe integer is an integer that can be exactly all integers from (2^53 &#8211; 1) to -(2^53 &#8211; 1)<br>This method returns true if the value is of the type Number and a safe integer.<br>Otherwise, it returns false.</p>



<script src="https://gist.github.com/vijaypk376/f3532004826a3db95488ecdd8eab380c.js"></script>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-use-number-methods-in-javascript/">How to use Number Methods in JavaScript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/how-to-use-number-methods-in-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
