:: Forum >>

SetFormat Question

I'm setting a money format like..

var number = new Active.Formats.Number;
    var string = new Active.Formats.String;
    number.setTextFormat("$ #,###.##");


If one of my records is null, it still comes up $ 0.00

How can I make it blank?
Scott
Wednesday, October 13, 2004
Anyone??
Monday, October 18, 2004
This is the last thing that I need to fix. When the money field for that record is null, it still displays $ 0.00. I'd like it to display nothing at all when it's null.
Scott
Tuesday, October 19, 2004
Here is a solution - you have to save the generated formatting function and use it inside your conditional statement:

var number = new Active.Formats.Number;
    number.setTextFormat("$ #,###.##");

    var _valueToText = number.valueToText;
    number.valueToText = function(v){
        return v ? _valueToText.call(this, v) : "";
    }


In the future I will add the possibility to specify a text for null value (similar to error text).
Alex (ActiveWidgets)
Tuesday, October 19, 2004

This topic is archived.


Back to support forum

Forum search