Hello everyone happy new year to all.

i want get length of only fractional part of number in java script function.
example if number is 4.321 then length of fractional part is 3. please help me.

thank you

Recommended Answers

All 3 Replies

Here is the code

<script lang='javascript'>
function fraclength(num)
    alert(num.split(".")[1].length) ;




thank you very much. it's working.

Time to learn difference between JSP (Java Server Pages) and JS(JavaScript). Post moved to Java Script section

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.