I am very new to free marker , I having an issue , I want to create a PDF using ftl , there I need to show the data as per locale ,data I want to format as per locale is (double)amount. e.g
DataDto{
double amount;
}
Now I want to show this data in pdf as per locale e.g. for fi_FI 1.00 -> 1,00 and for us_US 1.00 -> 1.00. I checked this and this and this too, but did not get any solid answer.. I tried to make method in dto which will return the formatted number as string but when tried to call this method in ftl got the error like InvalidReferenceException. I am not getting any way to get it done , Is there any way we can achieve this like can we using something is setting directives if I define locale in dto class and get it in ftl. or can call the method in ftl.
${data.amount?string("${data.locale}")} gives current locale-> en I dont know how to do it right
Any lead would be appreciated:) Thank you !