Expand my Community achievements bar.

The Community Advisors application is now OPEN for the second class of 2024. Apply to become a part of this exclusive program!

Adjusting Numeric Result to Include Zero When Result is a Whole Number

Avatar

Level 2

Hello,

I was able to remove the word Hours from my numeric results, but does anyone know how I can modify the text below so that my results include a decimal point and a zero (.0), when the result is a whole number? For example, instead of 7, I would prefer the result display as 7.0, without affecting numbers that are already fractions, such as 7.25?

aggregator.displayformat=minutesAsHoursString
aggregator.function=SUM
aggregator.valueexpression=ROUND(({workRequired}-{actualWorkRequired}),2)
aggregator.valueformat=compound
displayname=Remaining Hours
querysort=workRequired
styledef.case.0.comparison.icon=false
styledef.case.0.comparison.leftmethod=work
styledef.case.0.comparison.lefttext=work
styledef.case.0.comparison.operator=lt
styledef.case.0.comparison.operatortype=double
styledef.case.0.comparison.rightmethod=actualWork
styledef.case.0.comparison.righttext=actualWork
styledef.case.0.comparison.truetext=
textmode=true
valueexpression=CONCAT(SUB({workRequired},{actualWorkRequired})/60)
valueformat=HTML

Thanks for any help.

2 Replies

Avatar

Level 10

 

Very nice @khryc,

 

From this post listing the valid numeric valueformat options, I suggest you change the first line from

 

     aggregator.displayformat=minutesAsHoursString

 

to

 

     aggregator.displayformat=doubleAsFinancial

 

and (for consistency) the last line from

 

     valueformat=HTML

 

to

 

     valueformat=doubleAsFinancial

 

which should then force two decimals consistently at both the grouped (aggregator) and detailed level...one more than you really want, but all that appears to be available within the native settings.

 

Regards,
Doug

 

TIP: if this solved your problem, I invite you to consider marking it as a Correct Answer to help others who might also find it of use

Avatar

Level 2

Thank you Doug...that worked.

 

I tried applying the same logic to the following string,  so that it would have the double digit after the decimal (10.00), but it didn't seem to work, and when I try replacing valueformat=compound with valueformat=doubleAsDouble, it defaults back to compound. I'm just trying to have my 2 columns display consistently. 

 

aggregator.displayformat=doubleAsDouble
displayname=Planned Hours
listsort=int
querysort=workRequired
textmode=true
valueexpression={workRequired}/60
valuefield=workRequired
valueformat=compound
viewalias=workrequired 

 

Any ideas?

 

Thanks for your help.