javascript - How to get Last digit of number -


how extract last(end) digit of number value using jquery. because have check last digit of number 0 or 5. how last digit after decimal point

for ex. var test = 2354.55 how 5 numeric value using jquery. tried substr work string not number format

like if use var test = "2354.55";

then work if use var test = 2354.55 not.

try one:

var test = 2354.55;  var lastone = test.tostring().split('').pop();    alert(lastone);


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -