You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by David Van Stone <dv...@head.cfa.harvard.edu> on 2006/10/19 00:18:08 UTC

Float conversion difference?

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.