Click here to Skip to main content
15,918,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
JavaScript
var imagePos = $("#cursorImage").position();
var topValue=imagePos.top;

I would like to parse "topValue" to float and round its deciaml Position. I used toFixed() function but it's not working with position(). Could you Please help me?

[edit]Code block added[/edit]
Posted
Updated 26-Aug-13 22:18pm
v4
Comments
What value it gives, when you use toFixed()?

1 solution

C#
var floatvalue = parseFloat(topValue);

var intvalue = Math.round( floatvalue );
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900