myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Van Stone <...@head.cfa.harvard.edu>
Subject Float conversion difference?
Date Wed, 18 Oct 2006 22:18:08 GMT

I'm using JSF 1.1.3.

I have a property "value" in a backing bean which is a simple float:

   public float getValue() {
    return 8.3131313f;
  }

In my jsp I use two outputFormats to display the value. Note the space after
the first value:

<h:outputFormat value="{0}">
<f:param value="#{seqedit.value} "/> <%-- Note extra space --%>
</h:outputFormat>
<h:outputFormat value="{0}">
<f:param value="#{seqedit.value}"/>
</h:outputFormat>

These display as:

8.313131 8.313 

The two outputs truncate the float at different places. Why? It's more of a
curiousity for me at this point, now that I've identified why I was getting
different results in my application.

Thanks,

David
-- 
View this message in context: http://www.nabble.com/Float-conversion-difference--tf2470031.html#a6886973
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Mime
View raw message