:: Forum >>

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
Monday, January 21, 2008
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
Monday, January 21, 2008
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)
Monday, January 21, 2008
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("",")");
Tuesday, February 5, 2008
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
Wednesday, February 6, 2008

This topic is archived.


Back to support forum

Forum search