+ Start a Discussion
CRM JediCRM Jedi 

Problem with Numbers on Visualforce Page


I notice this weird behaviour of SFDC when it displays number on a VisualForce page.



 When the value is "15,000,000", the value displayed is "1.5E+7"


 But when I modify the last digit of the value to "15,000,001", it displays correctly as "15000001"



Is this a SFDC defect?

This is done to try and make the numbers easier to understand as 15,000,000 and 1.5E+7 are the same thing (what this means is move the decimal point 7 places to the right on 1.5). The reason the number displays correctly when you add the 1 to the end is you cant shorten 15,000,001 as it would just stay as 15000001E+0. I hope this makes some sense. Unfortunately I don't know how this can be resolved within a VisualForce page. Do you have any idea what type of number this is? Is it using a standard controller or a custom Apex controller?



You could try using advanced formatting. There isn't a direct example of what you'd like to achieve on that page, but there are links there to the Javadoc for formatting, which Apex wraps.



CRM JediCRM Jedi



jamz_2010: but "1.5E+7" is meaningless to the business.The same problem occurs for both Currency and Number type, and both type of controller.


weznolte: Other than formatting, we can also use "TEXT" to convert it to a normal string so it will be displayed correctly. What I am trying to achieve is just to display a value of a currency field on a VisualForce page :)