3.0.0

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
October 13,
Anyone??
October 18,
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
October 19,
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)
October 19,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.