[Home] [Help]
PACKAGE BODY: APPS.FA_ROUND_PKG
Source
1 PACKAGE BODY FA_ROUND_PKG as
2 /* $Header: faxrndb.pls 120.3 2005/07/25 09:58:11 yyoon ship $ */
3
4 PROCEDURE fa_round(
5 X_amount in out nocopy number,
6 X_book varchar2,
7 p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null) IS
8
9 h_precision number;
10
11 BEGIN
12
13 select curr.precision
14 into h_precision
15 from fnd_currencies curr, gl_sets_of_books sob,
16 fa_book_controls bc
17 where curr.currency_code = sob.currency_code
18 and sob.set_of_books_id = bc.set_of_books_id
19 and bc.book_type_code = X_book;
20
21 select round(X_amount,h_precision)
22 into X_amount
23 from dual;
24
25 END fa_round;
26 --
27 --
28 PROCEDURE fa_ceil(
29 X_amount in out nocopy number,
30 X_book varchar2,
31 p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null) IS
32 h_precision number;
33
34 BEGIN
35
36 select curr.precision
37 into h_precision
38 from fnd_currencies curr, gl_sets_of_books sob,
39 fa_book_controls bc
40 where curr.currency_code = sob.currency_code
41 and sob.set_of_books_id = bc.set_of_books_id
42 and bc.book_type_code = X_book;
43
44 select ceil(X_amount * power(10,h_precision)) / power(10,h_precision)
45 into X_amount
46 from dual;
47
48 END fa_Ceil;
49 --
50 --
51 PROCEDURE fa_floor(
52 X_amount in out nocopy number,
53 X_book varchar2,
54 p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null) IS
55 h_precision number;
56 h_int number;
57
58 BEGIN
59
60 select curr.precision
61 into h_precision
62 from fnd_currencies curr, gl_sets_of_books sob,
63 fa_book_controls bc
64 where curr.currency_code = sob.currency_code
65 and sob.set_of_books_id = bc.set_of_books_id
66 and bc.book_type_code = X_book;
67
68 select trunc(X_amount * power(10,h_precision)) / power(10,h_precision)
69 into X_amount
70 from dual;
71
72 END fa_floor;
73
74 END FA_ROUND_PKG;