Custom Format for percentage, how do i remove decimals?
Hi all, long time reader, first time poster.
Thanks very much for all the help and info I've already managed to gather from here.
So onto my question:
I've used a custom format as a work around to the divide by zero errors. It works perfectly, but sometimes it will show 33% or 33.333% or even sometimes 33.3333% (33 just an example).
What can I add to my script to make it so it has no decimals? Or worst case scenario, only 1 or 2 decimal places?
Also, just thought of a side question, is it possible to have it show blank rather than NaN?
The custom format script I've used is:
var numerator = + getField ( " RMTimely " ) . value ;
var denominator = + getField ( " RMTotal " ) . value;
if ( denominator ! = = 0 ) {
event . value = numerator / denominator ;
} else {
event.value = " " ;
}
Any help or guidance you can give me on this is much appreciated.
Thanks in advance.
Kyle
