Put the decimal value.
I have count the value of double type, and display it like this g.drawString(value,150,200);.
that value is 0.2763590405878399238
How to put the four decimal places of that value?
It is possible that your question has been answered before and is not far away ...
http://forum.java.sun.com/thread.jsp?forum=54&thread=362183&tstart=15&trange=15
Similar Messages
-
Regarding Ronding off the decimal value
Hi,
i have a decimal number as " 58240990.00 " , i wanted this to rounded value .
for example I am expecting to see 58241 for the above number.
shell we can do in any way.. if so please let me knw fast.. it is urgent..
thanks in advance.
thanks,
Suresh..Hi Suresh,
Use <b>ROUND()</b> numerical function.
ROUND(a) round decimal places up and down
ROUND(a,n) round up and down to the nth place on the right of the decimal point
ROUND(a,-n) round up and down to the nth place on the left of the decimal point
DATA V_F TYPE F VALUE '58240990.00'.
DATA V_ROUND TYPE I.
V_ROUDN = ROUND(V_F,'-4')
Thanks,
Vinay -
How to make the Decimal values into Round off value
Hi Experts,
I have an internal table with 3 columns, the 3rd column having decimal values, Now i want to convert the values in to whole number, Ex: 15.67 will be 15.7
Anyone plz help this.
Mohanahii
use following code
DATA:
wa_val type p decimals 2,
L_ANDEC like T006-ANDEC value 1,
wa_val2 type p decimals 1.
wa_val = '15.67' .
CALL FUNCTION 'ROUND'
EXPORTING
DECIMALS = L_ANDEC
input = wa_val
SIGN = '+'
IMPORTING
OUTPUT = wa_val2
EXCEPTIONS
INPUT_INVALID = 1
OVERFLOW = 2
TYPE_INVALID = 3
OTHERS = 4
WRITE:/ wa_val2.
regards
twinkal -
How to put the null value at the last of a select list
Hello,
I have a select list with a null value, I want the null value to be the last value in the list. It always appears in the top of the list, Desc and Asc order is not working.
Thank you in advance!
Edited by: Najla on Apr 1, 2013 10:37 PMHi,
Edited by: Howard (... in Training) on Apr 2, 2013 1:xx PM
The statement - I don't think it is possible to arrange the order of the null option in a select list.- is close. You can't control the order of the Null value if you add the Null value through the GUI. However, it can be added and controlled as part of a SELECT ...
One way is to add NULL to the "SELECT". Here the Yes/No are hard-coded but they could have been selected from a table:
select d, r from
select 'YES' d, 'Y' r from dual
union all
select 'No' d, 'N' r from dual
union all
select Null d, '<Null>' r from dual
) order by 1 desc NULLS lastHoward -
Best way to put the default values for the Form Items
Hi,
I am having a form with lot of default values as mentioned below..
Field value
created by :APPL_USER
creation_date SYSDATE
last_updated_by :APPL_USER
last_update_date SYSDATE
item1 value1
item2 value2Currently I am using Computation -> After Submit.....so whenever we create/update a record...these computaion takes place and the default values get inserted....THIS IS WORKING PERFECTLY FINE.
I want to know..if this approach is fine OR we may have some better approach to acheive this...????
Thanks,
DeepakDeepak,
Sample trigger code:
CREATE OR REPLACE TRIGGER "BINS1_APPLICATION_TBL"
BEFORE INSERT
ON APPLICATION_TBL FOR EACH ROW
BEGIN
-- Description: Insert creation_dt, creation_id,
-- lst_updt_dt and lst_updt_id
-- Maintenance:
-- Date Actor Action
-- ==== ===== ======
-- 20-Aug-2009 J. Wells Create.
:NEW.creation_id := V('APP_USER');
:NEW.creation_dt := SYSDATE;
:NEW.lst_updt_dt := :NEW.creation_dt;
:NEW.lst_updt_id := :NEW.creation_id;
SELECT APPLICATION_seq.NEXTVAL
INTO :NEW.APPLICATION_seq
FROM DUAL;
END bins1_APPLICATION_tbl;
ALTER TRIGGER "BINS1_APPLICATION_TBL" ENABLE
/Jeff -
Issue with printing the decimal value in smartforms
Hi experts,
Here I am printing the net valve in to smartforms.The problem is, valve i want to print is 4505.600.But it is displaying as 45056.00.It is in OMR currency. This problem occurs only for this currency.i am picking the value from PO.
I have used komv-kwert feild for display. Please give me the solution
Regards,
madhuHi Madhu,
I have faced similar problem in my Smartform with currency JPY with no decimal places at all.
To resolve this you have to specify Reference Currency with the Currency type under Global Definitions-->Currency/Quant.Fields. For example take your case :
Fieldname Reference Field Data Type
WA_FINAL-KWERT W_WAERS C CURR
*Here W_WAERS should contain OMR
*WA_FINAL-KWERT sould contain 45056.00 then your output will look like 4505.600
Thanks & Regards,
Rock. -
How could I put the default values in my dashborad
I have made a dashboard using QAAWS.As i go for preview i want to fix some default value in my chart.Kindly guide me.
Thanks
AbhishekHi,
you should be able to submit those defaults directly in the corresponding areas of your design worksheet.
Hope that helps,
David. -
Bex not showing the Exact decimal values
Hi,
I have a situation here where I created a formula variable Average. I have declared that formula with the help of one replacement path variable.
Now My question is when i execute the query, I am seeing the values for that formula varibale but these are getting rouding off.
let say if I the result of the formula varibale is 3.2 it is rounding off to 4.
formula variable is 2.8 it is rounding to 3.
I have checked the query properties by putting the decimal places, but still it is showing the same. I have also gone through the forums and I understood that we need to maintain values in T006 or goto SPRO and maintain Unit of measure there you have to give No of decimals. But here my question is what UOM i need to consider because its just a formula which contains numbers 3, 4, 5 and it is calculating on those. those values are nothing but the feedback survey results.
can anyone let me know how should i procced with that. whcih UOM should i consider and also what is the ISO code to be maintained? or is there any another solution for my problem where i can see the decimal places.
Thank you !!!Hi,
select the number under unit/currency while creating the formula variable.
then check the query in RSRT. -
How do I convert an alpha character from a text string to its decimal value
I am trying to find out the actual decimal value of a character in a string. So far the code below is as far as I got. I am able to get what I guess is a byte value.
This is for a school assignment:
The idea behind what I am trying to do is to design a hash function to store dictionary words into a bucket array hash table, without using the existing Hashtable.class
so far this is what I can come up with to get some kind of value for each character in the string, however, what I am trying to get is the decimal value for each character.
public static void main(String args[]){
String word = "abcdefghijklmnopqrstuvwxyz";
for (int i=0 ; i < word.length(); i++){
System.out.print((word.substring(i,i+1)));
System.out.print("\t : "+((word.substring(i,i+1))).getBytes());
Thankyou for any replies.I'm not sure I completly understand your goal- what you mean by "decimal value", but, if you simply want to find the byte value of each character in a String, you would probably be better off using getBytes() in a way like this,
byte [] bytes = string.getBytes();
Then, if you need to map that to a charcter, you could use a for loop like
for (int x = 0; x < bytes.length; x++) {
table.put((char)bytes[x], bytes[x]);
which assummes this bucket class of yours allows primitive data types like so (in Hashtable or HashMap, you would have to use a wrapper Object). I guess, my point reduces to, don't use substring and string search methods (like indexOf()), unless you have to because they are more expensive then just maping the array of bytes and chars, which seems to be what you are interested in doing. -
How to restrict the decimal place of a floating point number?
Hi,
Here is my code:
public void TwoDecimal(double u){
String w = Double.toString(u);
int c = w.length();
System.out.println(c);
if (c <= 5)
double a = Double.parseDouble(w);
System.out.println(a);
else
System.out.println("Invalid input!");
}I want to show a floating point number which has 2 digits and 2 decimal places, e.g. 45.82, 29.67. This number is input by user and passed as a parameter.
For those case like the above sample floating point numbers, it can display the proper value of 'c'. e.g. 45.67 will display 5.
However, when I passed 99999, it will show 7; 9999 will return 6, not 5.
So, if the user does not input the '.', does it append 2 implicit chars to it? i.e. 99999.0 and 9999.0. So, that's why it returned 7 and 6 for the length of the string respectively.
How can I fix it?
and
Does it has better algorithm?
Pls advise.
gogoWhen dealing with a known precision, in your case hundredths, it is often a good idea to use an integer type and add in the decimals on printing only. This is often the case in banking systems. Almost all of them use integer types, (read long) in pennies to store monitary values. Ever seen someone type in a value for a credit card machine? For something like $20 they press.. "2" "0" "0" "0" The machine knows the lowest denomonation in a cent, so it knows where to put the decimal place. I suggest you do something like this. It also helps to avoid base 2 round off errors.
-Spinoza -
How to restrict the decimal entry on dynamic table in adf 11 .6
Hi All,
JDev version 11.6
I have a usecase based on dynamic VO. How to restrict the decimal numbers on table columns . When user enter the decimal number .I have to show error message.
In order to achieve above requirement .I have added value change listener on table column .its not working as expected
<af:table rows="#{bindings.EmployeeDynamicVO.rangeSize}"
fetchSize="#{bindings.EmployeeDynamicVO.rangeSize}"
emptyText="#{bindings.EmployeeDynamicVO.viewable ? 'No data to display.' : 'Access Denied.'}"
var="row" rowBandingInterval="0"
value="#{bindings.EmployeeDynamicVO.collectionModel}"
selectedRowKeys="#{bindings.EmployeeDynamicVO.collectionModel.selectedRow}"
selectionListener="#{bindings.EmployeeDynamicVO.collectionModel.makeCurrent}"
rowSelection="single" id="t1"
styleClass="AFStretchWidth" autoHeightRows="-1"
columnStretching="last" contentDelivery="immediate" >
<af:forEach items="#{bindings.EmployeeDynamicVO.attributeDefs}"
var="def">
<af:column headerText="#{bindings.EmployeeDynamicVO.labels[def.name]}"
sortProperty="#{def.name}" id="c1">
<af:inputText value="#{row[def.name]}" id="ot1"
valueChangeListener="#{backingBeanScope.EmployeeBean.validateINputs}"
autoSubmit="true">
</af:inputText>
<af:outputText value="#{row[def.name]}" id="ot6"
visible="#{def.name eq 'Dummy'}"/>
</af:column>
</af:forEach>
</af:table>
So appriciate if any alternatives on above usecase. Thanks in advanceHI
Expected :as soon as user enter the decimal values in table column , it should throw the error message in new small new window
Getting the value change listener and validating , but its working only tab out (Because VO is dynamic )
please suggest us any reg expression and Validators to achieve the above scenario ? -
How to read the selected value of a dropdown list box
Hello,
I have 2 custom fields which are of type dropdown list on Accounts(CRMM_ACCOUNT) PCUI application details tab.I need to read the selected value of first dropdown list item,based on that second dropdown list will be populated.
I know where to populate the dropdown list box,it is in FILL_DROPDOWN_LISTBOX.
I dont know how to trap the selection made on dropdown list.
PLease guide me on how to trap the dropdown list field selection value.
Thanks in advance.
Thirumala.Hello,
Check what is done in standard for the fielf REGION which is inked to the country.
Otherwise, you can do the following :
- in field group customizing, for field 1, flag the 'send request' flag. So, when you change the value in this field via the dropdown, the MAC methods are immediately called.
- Put the new value in a global variable (GV).
- in the fill_dropdown_listbox method, get the value from this GV and based on it, filter the values for the dropdown of field 2.
Hope this will help you,
Regards,
Frederic -
Error saving purchase order data decimal values in SAP R/3
sir,
PO was created with currency japanese YEN using Tcode ME21N . The net price was showing 142502300 (in JPY).
when checked in EKPO table , it saved with a value 1425023.00 instead of 142502300 .
what can be done to correct this.
In PO Print out , it showing values as 1425023.00 which is wrong.
SPRO>> NET WEAVER >> GENERAL SETTINGS >> CURRENCY>> SET DECIMAL values FOR CURRENCY CODES is showing 0 decimals against JPY (Japanese YEN)
I want to know where else the Decimal values could have been set to 2 decimal places.
FOr other currencies like US Dollars there is no error.
Regards,
Srinivasa MurthyHello Srinivasa
Please check the forum Rules of Engagement - https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement.
Cross posting is not permitted. This issue is already raised in the application area forum which is probably correct. This does not look like a PI technical issue.
Regards
Mark Smyth
XI/PI Moderator -
How to load decimal values into a file using bcp in SQL Server 2000?
Hi everyone,
I'm trying to load data from a database table to a text file using bcp on SQL Server 2000. When I'm loading the decimal values, the values before the decimal are not being loaded into the file. How could I load the values before decimals?
Here are the DDLs and DMLs of what I'm trying to run:
CREATE TABLE [dbo].[Product_Sales](
[Year_of_Sale] [smallint] NOT NULL,
[Product_Type] [varchar](25) NOT NULL,
[Product_Group] [varchar](25) NOT NULL,
[Category_Type] [varchar](25) NOT NULL,
[Category_Group] [varchar](10) NOT NULL,
[Product_Count] [bigint] NOT NULL,
[Product_Amount] [decimal](19, 2) NOT NULL,
[Category_Count] [bigint] NOT NULL,
[Category_Amount] [decimal](19, 2) NOT NULL,
CONSTRAINT [PK_Product_Sales] PRIMARY KEY CLUSTERED
[Year_of_Sale] ASC,
[Product_Type] ASC,
[Product_Group] ASC,
[Category_Type] ASC,
[Category_Group] ASC
) ON [PRIMARY]
) ON [PRIMARY]
INSERT INTO [Yearly_Sales].[dbo].[Product_Sales]
VALUES(2010, 'Online', 'Web', 'Cameras', 'Electronics', 547, 0.00, 0, 0.00)
EXEC [master].[dbo].[xp_cmdshell] 'bcp "SELECT * FROM [Yearly_Sales].[dbo].[Product_Sales]" queryout D:\Yearly_Sales\Product_Sales.dat -c -T -S'
And the output I see in the file is:
2010 Online Web Cameras Electronics 547 .00 0 .00
The values before decimals are being truncated.
Thanks,
Bangaaram
Known is a DROP, Unknown is an OCEAN.You can modify the decimal column(s) in the table to varchar type before export. But it does not look good.
alter table [dbo].[Product_Sales]
Alter column [Product_Amount] varchar(20)
alter table [dbo].[Product_Sales]
Alter column [Category_Amount] varchar(20)
Does that make any sense?
Known is a DROP, Unknown is an OCEAN.
Basically you modify the decimal column to a varchar type before you run the bcp command for export. You can modify your source table or you can modify them on the fly. It is just a workaround.
Modifying the source wouldn't be a good idea. Never do that if you can't get your desired output.
Known is a DROP, Unknown is an OCEAN. -
How to round the fractional values in Abap webdynpro?
Hi Experts,
I have designed a screen in which I have a field called ANZHL(which is numberic field of infotype14) It is a fractional digits which needs to be rounded when it comes to display in my webdynpro application?
Here is my code .........
How to round the ANZHL field ?
**if start and end dates are changed then delete the old and insert the new else just mmodify the record
if ws_0014_temp-begda ne ws_edit-begda or ws_0014_temp-endda ne ws_edit-endda.
call function 'HR_INFOTYPE_OPERATION'
exporting
infty = '0014'
number = wd_this->w_pernr
subtype = ws_0014_temp-subty
objectid = ws_0014_temp-objps
lockindicator = ws_0014_temp-sprps
validityend = ws_0014_temp-endda
validitybegin = ws_0014_temp-begda
recordnumber = ws_0014_temp-seqnr
record = ws_0014_temp
operation = 'DEL'
nocommit = 'X'
importing
return = w_bapireturn.
" key = w_bapireturn.
if w_bapireturn-type ca 'EA'.
r_bapireturn = w_bapireturn.
return.
endif.
ws_0014 = ws_0014_temp.
ws_0014-endda = ws_edit-endda.
ws_0014-begda = ws_edit-begda.
ws_0014-anzhl = ws_edit-anzhl.
call function 'HR_INFOTYPE_OPERATION'
exporting
infty = '0014'
number = wd_this->w_pernr
subtype = ws_0014-subty
objectid = ws_0014-objps
lockindicator = ws_0014-sprps
validityend = ws_0014-endda
validitybegin = ws_0014-begda
recordnumber = ws_0014-seqnr
record = ws_0014
operation = 'INSS'
nocommit = 'X'
importing
return = w_bapireturn.
" key = w_bapireturn.
if w_bapireturn-type ca 'EA'.
r_bapireturn = w_bapireturn.
return.
endif.
else.
ws_0014 = ws_0014_temp.
ws_0014-anzhl = ws_edit-anzhl.
Edited by: Dharani us on Oct 8, 2009 10:15 AMHi,
For that attribute, you want to display the decimal values or what.
Regards,
Lekha.
Maybe you are looking for
-
Want to change data type CHAR32 to CHAR40 in cutomized function module(CRM)
Hi Friends, I have a requirement to change the data type CHAR32 to char40 . Pls guide me how to do it.do I need to change it directly or we have do anymore changes? Thx in Adv. Baba
-
Processing log output for Purchase order
Dear All, Iam getting some problem when iam creating an IDOC and checking in the Processing log for IDOC number. Actually i had created one custom idoc for Purchase order since my client need only some field and in one line for header and line item,
-
Creating custom UI panels : where to start ?
Hi, i've had a hard time searching for clear information on how to create custom panels in InDesign. Maybe the wrong keywords, i dont know, but here i am I would like to create a panel displaying all the "text variables" and their actual values and
-
Wow, for the Mac Users in the house... check it out.
http://www.lithoglyph.com/mondrianum You gotta check this out.
-
Hi All, I have a requiremnt to change the standard sap script(MEDRUCK). Can anybody help me out by giving me the steps how to change a standard SAP Script without copying it into y or z namespace. Thanks & Regards, Santosh