Monday 30 November 2015

You want to convert a string that contain hex value to a decimal?

You want to convert a string that contains hex value to a decimal? How can you do that?

For example:
var x="#fffffa"
You can't convert this type of string into decimal-number. Reason: because there is a pound (#) sign inside that string. Solution: remove the pound sign first.

This case is retrieving value from <input type="color">

 

No comments:

Post a Comment