How do you convert numbers between different bases in
JavaScript?

Answers were Sorted based on User's Feedback



How do you convert numbers between different bases in JavaScript?..

Answer / kmbkrishnan

using parseInt(value,base)

Is This Answer Correct ?    23 Yes 2 No

How do you convert numbers between different bases in JavaScript?..

Answer / venkateswaran

using Number() function we can converts the value of an
object to a number.

Example:

var test1= new Boolean(true);
var test2= new Date();
var test3= new String("999");
document.write(Number(test1)+ "<br />");
document.write(Number(test2)+ "<br />");
document.write(Number(test3)+ "<br />");

Is This Answer Correct ?    11 Yes 3 No

How do you convert numbers between different bases in JavaScript?..

Answer / rubin thomas

also parseFloat(number,base)

Is This Answer Correct ?    12 Yes 5 No

How do you convert numbers between different bases in JavaScript?..

Answer / heena

Use the parseInt() function, that takes a string as the
first parameter, and the base as a second parameter. So to
convert hexadecimal 3F to decimal, use parseInt ("3F", 16)

Is This Answer Correct ?    6 Yes 3 No

Post New Answer

More JavaScript Interview Questions

What is the use of anonymous function in javascript?

0 Answers  


Which software is used for javascript?

0 Answers  


What are the limitations of javascript?

0 Answers  


What are the four basic data structures in javascript?

0 Answers  


Write a program to reverse a string in pure javascript?

0 Answers  


coding of java scripts

0 Answers   Oracle,


How to set the cursor to wait in JavaScript?

0 Answers  


How to convert json string to object?

0 Answers  


How can a page be forced to load another page in javascript?

0 Answers  


Which is faster jquery or javascript?

0 Answers  


What is double exclamation point?

0 Answers  


Can any one tell me about s_objectID used for the anchor tag why it is used, what for and how to use it properly. with an example...please please......

1 Answers  


Categories