Jump to content
We've recently updated our Privacy Statement, available here ×

Format a number based on decimal digit


pumaking

Recommended Posts

 Hi,

 

I want to format a number based on it's decimal digits ( I hope the translation is correct)

example:

12,0 = new java.text.DecimalFormat("#,##0").format($V{Whatever})

12,7= new java.text.DecimalFormat("#,##0.0").format($V{Whatever})

I hope you understand my question. Is this possible?

Link to comment
Share on other sites

  • 1 year later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

This one worked for me..

($V{member_id_MEASURE1} != 0 ? (new DecimalFormat(".00").format(($V{member_id_MEASURE1}/$V{member_id_MEASURE1_deny_reasons1_ALL}) * 100)) : 0 ) + "%"

I added the new DecimalFormat(".00").format( calculations)  the + "%" is to give it like a percent look.

 
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...