Little change in the order of the if-cases,for avoid an error on  value = '' + gauge.getVal().valAsDouble();