# Error using formatNumnber function with 3 params

jballesteralejo
1

When I call the function in label value="${c:formatNumber(each.price, null,null))}, ZK returns back an error: The function 'c: formatNumber' specified 2 parameters, but 3 were declared But in the commonsFns there is the next function: formatNumber(java.lang.Object number, java.lang.String pattern, java.util.Locale locale) Formats a number (Integer, BigDecimal...) into a string. delete retag edit ## 2 Answers Sort by » oldest newest most voted answered 2021-05-20 12:41:12 +0800 hawk 2837 1 5 http://hawkphoenix.blogsp... It's a bug, thank you for reporting this problem. Please find a workaround at https://tracker.zkoss.org/browse/ZK-4902 But according to your code ${c:formatNumber(each.price, null,null)} You pass null as the 3rd parameter, you can just call with 2 parameters:

\${c:formatNumber(each.price, null)}

Ref doc: ZUML Reference / formatNumber

hawk
2837 1 5
http://hawkphoenix.blogsp...

you can also declare the method with 3 parameters as a xel method then call it.

[hide preview]