2

I can use fn:length(mystring) to find the length/number of character of a string.

How can I find the length/number of digits in an integer?

e.g. if my int is 3000, I want to return 4.

BalusC
  • 1,040,783
  • 362
  • 3,548
  • 3,513
fxfuture
  • 1,832
  • 3
  • 24
  • 39

1 Answers1

2

Convert it to String first by evaluating it as body of <c:set>:

<c:set var="intAsString">${someInt}</c:set>

Then you can get its length the usual way:

${fn:length(intAsString)}
BalusC
  • 1,040,783
  • 362
  • 3,548
  • 3,513