3.0.0

present my negative value

Hi

I have a small, I want to present my negative value of my column Amount between parenthesis eg
-25.36 -----> (25.36)

Please
fethioran
January 21,
I have problem in mygrid,I want present my negative value of my column Amount between parenthesis example:
Amont
- 25.36
36.25
- 12.56
11.12

I want present like

Amount
(25.36)
36.25
(12.56)
11.12
fethioran
January 21,
There is no built-in format which does that. You have to make your own formatting method in AW.Formats.Number object -

var num = new AW.Formats.Number;
num.valueToText = function(value){
  if (value>0){
    return ...
  }
  else {
    return ...
  }
}
Alex (ActiveWidgets)
January 21,
I trying for this solution but not working in my grid:

var number = new AW.Formats.Number;
number.textToValue=function(v){v = v.replace("-","(").replace("",")");
February 5,
You might want to try this.

var num = new AW.Formats.Number;
num.valueToText = function(value){
if (value>0){
return value+"";
}
else {
return "(" + (value * -1) + ")";
}
}
Wai
February 6,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.