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,082,665
  • 372
  • 3,610
  • 3,555
fxfuture
  • 1,910
  • 3
  • 26
  • 40

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,082,665
  • 372
  • 3,610
  • 3,555