Home » Developer & Programmer » Reports & Discoverer » format mask
format mask [message #457529] Tue, 25 May 2010 01:30 Go to next message
dhinendra
Messages: 58
Registered: September 2009
Location: Gurgaon,India
Member
hi
I am using NNNGNNNGNNNGNNDNN format in format mask so i am getting my value as 15,320,03.07 but i want to print it like 15,320,03.00
so what format i must used to implement this.



Thanks
Dhinendra
Re: format mask [message #457532 is a reply to message #457529] Tue, 25 May 2010 01:51 Go to previous messageGo to next message
Littlefoot
Messages: 21562
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Mask can't do that - you'll have to ROUND the value.
Re: format mask [message #457533 is a reply to message #457529] Tue, 25 May 2010 02:01 Go to previous messageGo to next message
dhinendra
Messages: 58
Registered: September 2009
Location: Gurgaon,India
Member
hi littlefoot
round is still giving me the same output but i need to place zero's after decimal.means if value is like .89 then i want to print .00 instead of .89.


Thanks
Dhinendra
Re: format mask [message #457535 is a reply to message #457533] Tue, 25 May 2010 02:06 Go to previous messageGo to next message
Littlefoot
Messages: 21562
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
So, you don't care about decimals at all? If so, truncate the number:
SQL> select trunc(104.23) t1, trunc(104.89) t2 from dual;

        T1         T2
---------- ----------
       104        104

SQL>
Re: format mask [message #457537 is a reply to message #457529] Tue, 25 May 2010 02:16 Go to previous messageGo to next message
dhinendra
Messages: 58
Registered: September 2009
Location: Gurgaon,India
Member
hi littlefoot
yeah i don't care at all about value after decimal but i have to show .00 after value so is there any way to do this.

Thanks
Dhinendra
Re: format mask [message #457538 is a reply to message #457529] Tue, 25 May 2010 02:20 Go to previous messageGo to next message
dhinendra
Messages: 58
Registered: September 2009
Location: Gurgaon,India
Member
actually littlefoot
i am using this concept in cheque printing that's why i need this condition to fulfill.


Thanks
Dhinendra
Re: format mask [message #457545 is a reply to message #457538] Tue, 25 May 2010 02:49 Go to previous messageGo to next message
Littlefoot
Messages: 21562
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
OK then, truncate the value and apply format mask. For example: in a query you'd
select trunc(104.89) t1, trunc(25.34) t2
from dual
and apply format mask as NNNGNN0D00. Note zeros instead of Ns.
Re: format mask [message #457546 is a reply to message #457529] Tue, 25 May 2010 02:59 Go to previous message
dhinendra
Messages: 58
Registered: September 2009
Location: Gurgaon,India
Member
hi littlefoot
now it is working i have used the trunc in my code and NNNGNNNGNNNGNN0D00 this format in format mask.


Thanks
Dhinendra
Previous Topic: spreadsheet
Next Topic: Report display problem (merged by CM)
Goto Forum:
  


Current Time: Mon Jun 01 18:48:25 CDT 2020