Is it possible to use FormatFloat on a ValueAtTime within a table display in RTMCpro? I've got the ValueAtTime expression working fine, but I can't figure out the syntax for rounding that value to the nearest single digit.
Thanks,
Alex
Assuming that I understand your question, here is an example that uses the alias() function to simplify the expression:
Alias(value, "src:station.table.value");
FormatFloat(
ValueAtTime(value, timestamp(value), nsecPerDay, 0),
$"%.0f"))
* Last updated by: jtrauntvein on 12/22/2011 @ 10:25 AM *
I've only been able to get alias to work in digital displays, never in a table display. I've tried the actual value name as well as the "original value" that is in the manage columns window of the table display.
So, since alias doesn't seem to work in tables, I got this working:
FormatFloat(ValueAtTime("WindSpd",TimeStamp("WindSpd"),
TimeStamp("WindSpd") MOD nSecPerHour,6999),$"%0.0f")
But when I tried to extend this formatting to a rather complicated IIF expression, it didn't work. Oddly, it did work with ROUND, which will have to do. It would be perfect if round actually removed the trailing zeros the way it indicates in the on-line help.
I've commented on this before, but it bears saying again; it sure is frustrating that all of the elements of of RTMC don't use the same syntax for expressions.
I'm sorry, I did not notice in your original post that you were using the table display. I also noticed that I had forgotten to add a '$' before the format string in my example.
Try replacing $"0.0f" with $".0f".
Yes, I noticed the lack of a $ and just figured you left it out by mistake. That's not the problem and I've tried both $"%0.0f" and $"%.0f" and it doesn't seem to make any difference. Did you mean to leave the % out of your last post?