Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Decimal Format with DynaFormBean

 
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!!!
Is there a way of displaying data with the deciaml pattern let's see if the user enter 123 it will dispaly 12.3
I can do this with the format of the bean write but i did not figure out how to do it when I redisplay the data I 'm using DynaFormBean.

Thank's
 
Author
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reda, you can use
<fmt:formatNumber value="12.3“ pattern=".00"/>
This would output: 12.30
This is one of the actions from the JSTL, but can be used with Struts. You can access your value as an expression like value="${mynumber}" . Check out the struts-el libs from the contrib folder if you want to use the expression lanaguage with other Struts actions.
Sue
 
Reda Mokrane
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks's Sue For the quick answer.
The problem is that I'm not using JSTL.
when I use the decimal Pattern format it work's fine with the bean:write tag but not with html:text.
This work: bean:write format=".00" but not this one html:text format=".00" .
Thank's again
 
My, my, aren't you a big fella. Here, have a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic