
adccommunitymod (AutomationDirect) asked a question.
Created Date: November 06,2015
Created By: pioplastic
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
When using the STRPRINT command, is there a way to set the default real number format to dec instead of smart? The STRPRINT command by default will use scientific notation for a number (48,000.0) unless the FmtReal is defined. I have many of these operations and it would be nice to never use scientific notation without having to format it every time for each real number. Example code for STRPRINT: FmtReal(R141,1,1,dec,commas) " ml " "( " R142 "%) " SS15
Created Date: November 06,2015
Created by: plcnut
is there a way to set the default real number format to dec instead of smart?
No, there is not a way to set the default.
Created Date: November 06,2015
Created by: franji1
is there a way to set the default real number format to dec instead of smart?
Great idea. This would need to be implemented at the editor level (not PLC level). Basically, if you had this set up, whenever you entered "R10 " in the STRPRINT editor, the editor would put in
"FmtReal(R10,1,1,dec,commas) "
in the STRPRINT where the R10 existed.
When you went back in the editor, it would fully display the verbose FmtReal expression. Again, this would just be a helper for editing when entering new R elements, which I think is your issue. Also, you could easily override it by changing the "dec " to "smart " upon re-entering the editor.
Additionally, we could make this "default format " be optionally available for each "format " type (e.g. FmtTime, FmtInt, FmtString, etc.).
No promises, though, but we'll look at it. Again, great idea.
Created Date: November 06,2015
Created by: pioplastic
When using the STRPRINT command, is there a way to set the default real number format to dec instead of smart? The STRPRINT command by default will use scientific notation for a number (48,000.0) unless the FmtReal is defined. I have many of these operations and it would be nice to never use scientific notation without having to format it every time for each real number.
Example code for STRPRINT:
FmtReal(R141,1,1,dec,commas) " ml " "( " R142 "%) " SS15