Rounding off Amount which has 3 decimal places
Dear All ! !
Urgent Help required i need to round the Amount of 3 decimal pleaces for example
300.777 should be round to 300.800
300.340 should be round to 300.300
or
300.977 should be rounded to 301.000
Payroll in international for Bahrain and Oman both currency value is too high but they use to round after decimal. Can any one Guide any function any operation or some other solution will be highly regarded
Thanks
Syed Baddar
Hi
You can do this by writing a rounding calculation rule.
Or ask an ABAPer to write a simple routine in payroll driver program RPCALCX0. It has an exit where he/she can write a small routine for this.
Regards
Waz
Similar Messages
-
Rounding off a float to two decimal places
I want to make a function where I shall pass a float and and integer.
The float shall have to be rounded off to a value in the integer.
Can anyone please suggest how to round off a float.
E.g.: if the float is 12.56890 and I want to round it off to 2 decimal places, then it should be 12.57.
Regards
HawkerI didn't mention any datatypes like float, double.True, but that is what the question is about, so you weren't answering the question. For a change.
As I mentioned, that was just a mathematical steps to round of the floating point value. (Not in any programming languages point of view).False. You didn't mention that at all.
This is the code for that in java.So here you are mentioning datatypes and floats for the same piece of mathematics that you have already been told, with reasons, doesn't work in floating point.
which seems to be working fine
Seems to. What evidence do you have that the float actually got rounded? As opposed to got displayed as rounded? Which is not what the OP asked for.
And of course all that code seems to do is round 0.01 to two decimal places, which again is not what the OP asked for.
For any remaining fans of this 'technique', please explain the behaviour of the following code:
public static void main(String[] args)
int count = 0, errors = 0;
for (double x = 0.0; x < 1; x += 0.0001)
count++;
double d = x;
int scale = 2;
double factor = Math.pow(10, scale);
d = Math.round(d*factor)/factor;
if ((d % 0.01) != 0.0) // if 'd' really has been rounded this should be zero
System.out.println(d % 0.01);
errors++;
System.out.println(count+" trials "+errors+" errors");
} -
Any function module to round of a value to two decimal places?
Hi gurus,
Any function module to round of a value to two decimal places?Hi,
you can use FM 'ROUND'.
Thanks. -
Rounding off during APP (f110) of decimal point
Hi
Can any one help me? When I run the T.Code f110 for automatic payment programme is generate cheque propaly, here my client want to rounding off for the decimal point in cheque amount as if coin adjastment.Hello Arup,
I guess OB90 is helpful to you so pls check the same.
Thanks & Regards,
Lakshmi S -
Rounding a quantity field to one decimal place. PLEASE URGENT
I have a quantity field with three decimal places. I have to print this field with only one decimal place. This is in a smartform.
suppose: qty = 45.678
I want it to be printed as 45.7
Thanks in advance.Hi Riki,
I think you can use Function Module ROUND to round off the value...
REPORT ZTEST_SHAIL4 .
data: out type p decimals 1,
inp type f.
inp = '45.678'.
CALL FUNCTION 'ROUND'
EXPORTING
DECIMALS =
input = inp
SIGN = ' '
IMPORTING
OUTPUT = out
EXCEPTIONS
INPUT_INVALID = 1
OVERFLOW = 2
TYPE_INVALID = 3
OTHERS = 4
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Now use the variable 'out' to display the rounded off value...
Regards,
SP. -
Rounding off : Amount at GL Account Wise
HI Gurus,
My Client has a requirement, they want to round off the amount g/l account wise,
like for some g/l account they don't want to round off and vice versa,
so is there any setting available at g/l account level.
Thanks & Regards
Abdul QadirHi Abdul Qadir,
Welcome you post on the forum.
The rounding function will affect all documents. There is no configuration available for your request. You may try SDK to reach your goal.
Thanks,
Gordon -
Rounding and remving of zeros at decimal places
i have columns like
quantity, weight, volume, length, width, height
if its values are 4.666 means under 5 then it should conver to 5 else if its 5.677 then it should round off the value and ifs 5.000 then it should remove the 000 and print 5 on screen is there any function to do this step.Hi,
Check this sample:
DATA: WA_INPUT TYPE P DECIMALS 8,
WA_OUTPUT TYPE P DECIMALS 2.
WA_INPUT = '5678.65800341'.
CALL FUNCTION 'ROUND'
EXPORTING
INPUT = WA_INPUT
IMPORTING
OUTPUT = WA_OUTPUT
EXCEPTIONS
INPUT_INVALID = 1
OVERFLOW = 2
TYPE_INVALID = 3
OTHERS = 4.
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE: WA_OUTPUT.
Regards,
Chandru -
Changing number of decimal places for Unit of Measure
Hi All,
I have a requirement to convert a quantity in one unit of measure to another (custom) unit of measure.
The issue is that the custom unit of measure has 4 decimal places (customer requirement). I found function module MD_CONVERT_MATERIAL_UNIT which does the trick for regular, 3 decimal places, UoM's. It won't output 4 decimal places since the output data type is EKPO-MENGE, which has 3 decimal places.
Does anyone have experience with trying to convert material's UoMs into 4 or more decimal places?
Thanks!<b>round_f_to_15_decs</b> round variable of type f to 15 decimals
Sometimes type F (float) is used to represent exact data (Amounts, Quantities):
if values are to big to be represented as Packed (> 31 decimals)
to significally improve performance of calculations, e.g. in statistical reports
G_DECIMAL_PLACES_GET
REPORT Z_ROUNDING .
DATA: float TYPE f,
amount TYPE p DECIMALS 2,
correctamount TYPE p DECIMALS 2,
chars(5) TYPE c value '1.005'.
CLASS cl_abap_math DEFINITION LOAD.
correctamount = chars.
WRITE: / 'Exactly:', chars,
/ 'Correct Amount:', correctamount.
float = chars.
amount = float.
skip 2.
WRITE: / '==== Usual Processing:',
/ 'Float:', float,
/ 'Decimals 3:', float DECIMALS 3,
/ 'Decimals 2:', float DECIMALS 2,
/ 'Amount:', amount.
float = cl_abap_math=>round_f_to_15_decs( float ).
amount = float.
skip 2.
WRITE: / '==== Correct Processing:',
/ 'Float:', float,
/ 'Decimals 3:', float DECIMALS 3,
/ 'Decimals 2:', float DECIMALS 2,
/ 'Amount:', amount. -
i have some fields of datatype curr and domain wertv6/wertv7...which has 2 decimal places..
but in my screen i'm getting 5 decimal places for all those fields....how is this happening?hi Anil,
go to se84
expand abap dictionary
go to data element
and write domain name = wertv6,data type = curr,decimal = 2
you will find lots of data element.
hope it solves your problem
thanks
Sachin -
Convert amount with four decimal places to amount with two decimal places
Hi,
for specific reasons we have set the prices to four decimal places. However, in an invoice the staff needs to see all prices with two decimal places. Therefore I have created new user-defined fields which should show the rounded values However, I have not yet found the right formatted search that outputs the value with two decimal places including currency symbol.
The statement
SELECT $[$38.20.NUMBER]
outputs the value with two decimal places which is fine, but it does not contain the currency.
The statement
SELECT $[$38.20.0]
outputs both value and currency, but the value still has four decimal places as the original price.
And the statement
SELECT CAST($[$38.20.NUMBER] AS VARCHAR(20)) + $[$38.20.CURRENCY]
outputs a value with even six decimal places.
Did anyone already have the same problem???
Or does anyone have any idea???
Thanks and regards
CorinnaHi again,
the value should be displayed in a user-defined field of the screen.
The result of the query
SELECT $[$38.20.NUMBER]
has already two decimal places, so that I do not need a round here. But the currency is missing.
When I add the round function to the query
SELECT $[$38.20.0]
it does unfortunatly result in an error.
Any ideas????
Thanks so much in advance! -
Download amount value without decimal place but element with decimal place
Hi all,
to display the amount without decimal places in classic report, i can use this way which is wa_wrshb NO-ZERO CURRENCY wa__waers.
may i know,
1) how to display amount in ALV where amount value (which using dmshb/wrshb) has no decimal place like JPY?
2) what should i do if i want to download the amount value which field using dmshb or wrshb that the value has no decimal place like JPY?
ThanksHello,
You can display the ALV output according to the decimal point in the currency.
When creating the field catlog for the amount field add the currency parameter also.
wa_fieldcat-fieldname = <amount_field>.
wa_fieldcat-tabname = <output_table>.
wa_fieldcat-seltext_l = <column_heading>.
wa_fieldcat-outputlen = p_olen.
wa_fieldcat-currency = wa_waers. " This will work same as CORRENCY wa_waers
Regards
DKS -
Pages rounding up numbers in a .doc file to 2 decimal places
Hello, I have a problem, with Pages (3.4) on OS 10.7.5...
When I go to open a .Doc file, Pages seems to round up some numbers to 2 decimal places. I did find another thread which dealt with this problem inside of Tables, but I am not using tables in this document.... another problem is that the new rounded up number is not editable in Pages once the document is open. e.g.
In word/open office I see the figure (which is in fact a series of dates - i did not write this document btw)
12.12.24.1.13
in Pages is only see
.13
and this .13 is totaly un-editable and unselectable.
Can you help ?Got it!
I tried opening it in TextEdit but the funky dates were omitted from the page. Then I opened it in LibreOffice and it looked OK. The problematic dates seemed created by a special Word function. The behaving dates were manually written.
I selected all content of the document in LibreOffice and pasted into a Pages document and all dates came out as they should. -
BED & AED Round up or down without decimal places
Dear Gurus,
My client wants BED & AED Round up to nearest value without Decimal places.
I am using taxinn procedure and JMOP for BED and JAOP for AED As a condition.
I tried to tick round up in condition , but it is not workig.
Please help.Hi,
In TAXINN T code : OBQ3 against ur condition in alternative calculation type (Calty ) column put 17.
At the same time OB90 against ur company code put 100.
Then ur problm will be resolved.
Biswajit -
Rounding to 2 decimal places WITHOUT using any formatting class
Hello
I'm trying to round a number (double) to 2 decimal places without using any of the formatting class like (DecimalFormat or Math.Round and BigDecimal). Is it possible to do it by just using typecast?OP:
BigDecimal is not a formatting class. Math.round isn't a class at all.
Typecasting doesn't really do that sort of thing at all (unless you count dropping fractional components when casting to an integer type).
double holds values in binary format, so it's basically impossible to round to decimal values meaningfully.
Chuck:
I thought that BigDecimal supported arbitrary decimal precision, so one doesn't have to do that sort of thing....? -
Rounding off salary components in Payresult table
Hi Experts,
I have a query around rounding off amounts in PC_PAYRESULT cluster. The basic pay should be rounded off two places from decimal ( This is done by v_512w_d, changing PC -10 (A)) but for other wage types the rounding of rule is no value post decimal and rounding off the amount after decimal to next number.
Really appreciate any help on the same. Thank you so much for all your support.
Regards,
J
Edited by: jyotsgsap on Aug 1, 2011 1:29 PMSorry , in case of wrong communication from my side, when i said about the process class 10 Spec A , it means this is the standrad one which was been provided by the SAP so for the wage types which are in IT0008 if they come into proration (i means PRCL 10 as 1 and if all them has to be rounded off in such cases instead of useing the PCRs we can go with the standrad one so i have said to go in the said manner in the previous thread) in standrad to round off the wage types we have to go with Custom PCRs if you are asking for Wage types in IT008 , 0014 , 0015 Etc
the pcr shd be inserted below XVAL if any or else u can use Spec A for wage types IT0008 , for wage types in IT0014 and 0015 you can use INAP
Maybe you are looking for
-
How can I transfer pictures from my iPhone 5s to iphone 6
I Cannot get my pictures to transfer to my new iPhone 6 when I from my old iPhone 5S. It usually always transfers everything when you sign in with your apple ID
-
Getting pls-00428 error.
Hi all, I'm trying to fix some invalid objects in our 11g database and i'm getting a pls-00428 error. Not sure where the issue is originating at (keep in mind, my IT team and I are not thoroughly experienced with 11g, so I apologize if this sounds a
-
Error in syntax .check manual
Hi I am getting on value of variable(sj) from database and storing in list and using that value to get ID from same table. Now problem ---- if value of variable (psj = yyuyu "ghgh jkjkj" ghghg ) OR (psj=hjhjhj 'hjhjh jkjkj' hhjhjh).It gives error "yo
-
Home connect speaking volume too loud
I recently purchased Home connect. I have 3 bars of signal. The speaking volume is so loud that the audio is breaking up and severly distorted. We purchased new high end Panasonic cordless phones-same problem. The corded phone sounds the same. I
-
IOS4 upgrade created multiple calendars out of one
I use MobileMe to keep a "Master" calendar sync'd across all my devices - iPhone, iPad, laptop, etc. It has been working fine. After upgrading my 3G to iOS4, iCal on all my devices now shows multiple master calendars, with my "master" events spread o