Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

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
 
I am going down to the lab. Do NOT let anyone in. Not even this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!