Author Topic: Using BasicLabel to display a Real Value = 0 shows nothing  (Read 1951 times)

scott.clark

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Using BasicLabel to display a Real Value = 0 shows nothing
« on: October 30, 2015, 08:22:06 PM »
I am using a basic label to display floating point values of the Real type.  If the value happens to be exactly 0, then nothing is displayed.  What can be done?

Thanks!

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Using BasicLabel to display a Real Value = 0 shows nothing
« Reply #1 on: October 30, 2015, 08:47:24 PM »
Do you have anything in NumericFormat? I just tested it with 0.1 and 0 in my PLC and I had values show in both cases.

scott.clark

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: Using BasicLabel to display a Real Value = 0 shows nothing
« Reply #2 on: November 02, 2015, 05:23:49 PM »
I had "#.##" in the NumericFormat Property instead of "0.00"     

Does NumericFormat property do anything else in addition to the specifying the number of decimal places?

Thanks!


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Using BasicLabel to display a Real Value = 0 shows nothing
« Reply #3 on: November 02, 2015, 05:32:17 PM »
Does NumericFormat property do anything else in addition to the specifying the number of decimal places?
It is based on the ToString method. This web site gives a great amount of details on the formats that can be used:

https://msdn.microsoft.com/en-us/library/kfsatb94(v=vs.110).aspx

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Using BasicLabel to display a Real Value = 0 shows nothing
« Reply #4 on: November 02, 2015, 05:34:51 PM »
This is another link that also may be helpful:

https://msdn.microsoft.com/en-us/library/dwhawy9k(v=vs.110).aspx