var value = 10/2;
I want to take length of the variable value. How to take it?

Recommended Answers

All 2 Replies

Member Avatar for diafol

As in number of characters?

10/2 = 1 (5), 10/4 = 3 (2.5). Fun with 10/3

value.toString().length;

As per above code, We first have to convert our integer value to string for find it's length.

Be a part of the DaniWeb community

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