Numeric value of a Character
What is the difference between numerical value and unicode value of a character.
Character.getNumericalValue('a'); --> returns 10
Character.getNumericalValue('A'); --> returns 10
System.out.println(((int)'a')); ---> outputs 97
System.out.println(((int)'a')); ---> outputs 65
Can any one help me understand?
[url http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Character.html#getNumericValue(char)]the api is your friend :)
Similar Messages
-
How to display 'Alpha numeric values' in lower character?
Hi,
We have 'Alpha numeric value' in one column and i need to display alphabets in lower character.
I tried but throwing error.
SQL> select * from a439487.ora_dev_inventory;
HOST_NM HA INV_DT
SMMK94 - 21-AUG-08
SQL> select to_lower(HOST_NM) from a439487.ora_dev_inventory;
select to_lower(HOST_NM) from a439487.ora_dev_inventory
ERROR at line 1:
ORA-00904: "TO_LOWER": invalid identifier
I want 'HOST_NM' to be displayed in lower value.
I need o/p like 'smmk94'.
Any idea?Where did you find the TO_LOWER function? Can you
show us?I would guess it was just an assumption based on the fact we have to_char, to_date, to_number...
;) -
How 2 convert numeric value to character value?
Hi friends,
I want to convert numeric value to the character value.
Is there any FM available?
Points rewared soon.
Regards
RonnREPORT ZSPELL.
TABLES SPELL.
DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.
DATA : PAMOUNT LIKE SPELL-NUMBER VALUE '1234510'.
SY-TITLE = 'SPELLING NUMBER'.
PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.
WRITE: 'NUMBERS', T_SPELL-WORD, 'DECIMALS ', T_SPELL-DECWORD.
FORM SPELL_AMOUNT USING PWRBTR PWAERS.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = PAMOUNT
CURRENCY = PWAERS
FILLER = SPACE
LANGUAGE = 'E'
IMPORTING
IN_WORDS = T_SPELL
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3.
ENDFORM. " SPELL_AMOUNT -
Function module to convert character value of month into numeric value?
Hi Experts,
I need to convert a character value of a month in three alphabets to its numeric value.
e.g. 'jun' should be converted into '06' and 'jan' into '01' using a function module.Can anybody please provide me a similar function module?
TIA
Abhishektry this code:
DATA: text(20) TYPE c,
date TYPE sy-datum.
text = '06. Jul 06'.
TRANSLATE text TO UPPER CASE.
TRANSLATE text USING '. '.
CONDENSE text NO-GAPS.
CALL FUNCTION 'CONVERSION_EXIT_SDATE_INPUT'
EXPORTING
input = text
IMPORTING
output = date.
WRITE date USING EDIT MASK '__.__.____'.
Regards,
Dara. -
How to move the value from a character field to numeric or packed decimal
Hi,
can anyone explain me on how to move the value from a character field to numeric or packed decimal.
Please help me on this. Thanks...
Regards,
Rose.Hi ,
if you use keyword MOVE u may loose the decimal and thoussan separator and if u don't want to loose them just call the FM ..HRCM_STRING_AMOUNT_CONVERT.
i doubt wherther it is HRCM or HCRM just try using *
this will suit ur requirement.
Regards,
KK -
Guid Downloading Character field with numeric value
Hi All,
I am downloading one table through gui_download, file type is asc. While downloading the internal table contains one field
w_lif(20) type c, which contains the value '1234545567' all numeric value, now in excel it is displaying as exadecimal , here i need to convert the type of the column in excel to see the actual value.
could you please tell me , how to get actuall value directly to excel
your valuable help is appreciated.
Regards,
Siddivinesh JoguHi,
You can try the File Type as DBF. This retains the format of all the columns as Data.
Please let me know if this help,
Regards,
Janani -
Filter Numeric Value between Character
Dear All
I have a field name "ControlName " in SQL Server 2012 table. How do I get the int value after 'B' and before 'C' from
ControlName
AB123C7
B1234C9
I want to get result like
ControlName
123
1234
Thanks in advance
RegardsI have come across one solution from stackoverflow with XML Path to remove the non numeric value from a string and I modified the code to work for you as an example:
create table test (ControlName varchar(100))
insert into test values( 'AB123C7'),('B1234C9')
;with processTable as (
select Cast(ControlNameNum as int) ControlNameNum
from test
cross apply (
select (select C + ''
from (select N, substring(ControlName, N, 1) C from (values(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12)) Num(N) where N<=datalength(ControlName)) t
where PATINDEX('%[0-9]%',C)> 0
order by N
for xml path(''))
) p0 (ControlNameNum)
SELECT ControlNameNum
FROM processTable
drop table test
http://jingyangli.wordpress.com/2014/03/18/a-sample-to-remove-non-numeric-values-from-columns/
http://stackoverflow.com/questions/18625548/t-sql-select-query-to-remove-non-numeric-characters -
XDOFX if-then-else command testing of space and numeric value
Hi,
I have the following xdofx statement in a RTF template to display the value of one variable or another, depending on the value it contains: (the variable can contains both space or null or a numeric value).
<?xdofx: If Amount_1 = " then 'display amount_2' else If Amount_1 = 0 then 'display amount_2' else 'display Amount_1' end if?>
Result: When Amount_1 variable contains space or null value, then this If-then-else statement works. But When Amount_1 contains a number such as 0, it gives error "SBL-OMS-00203" (when it's checked against [=" ] in If condition). What's causing this? Is XDOFX being confused to test a variable that supposedly a character string (default by testing against [ =" ]), but find a number in the variable?
Any work around solution? (So [=" ] and [=0 ] can both be specified against a variable in an if-then-else statement in XDOFX).
Thanks a lot.
A.try
<?xdofx:if (Amount_1 =’’) then ‘display amount_2’ else if (Amount_1 =’0’) then ‘display amount_2’ else ‘display Amount_1’ end if?>or
<?xdofx:if (Amount_1 =’’) then ‘display amount_2’ else if (to_number(Amount_1) =0) then ‘display amount_2’ else ‘display Amount_1’ end if?> -
How do u convert a numeric value to char
hi,
how do u convert a numeric value NUMBER(22) to a character value.... like a to_char() function?
i've tried the CAST function it won't work.Hi,
Use of CAST function will convert NUMBER to CHAR but it takes a lot of time if there are large number of recrods.
Syntax:
CAST(col_name AS char)
I have tried this, it worked fine for less records.
Are you getting any error while using cast function or while querying..
As far as I know it won't give error in these cases (if correct syntax used) but it will take very much time (depending on the number of records) while querying.
-Vency -
ABAP-based web service returns numeric values with leading zeros
Hi SOA experts,
I have created a web service out of an ABAP function module. Beside other values, this service returns a list of document numbers. All of these numeric values are returned by the web service with leading zeros, but we do want these values w/o leading zeros.
Any ideas how I can tell the web service to not print any leading zeros?
Thanks in advance for your help!
Kind regards, Matthias
PS: The according function module does not print any leading zeros for the numeric valueshi,
just a guess: I'd try to use I instead of NUMC for the document numbers.
NUMC is no number but a character string with numeric characters only. only some display routines in SAP know that this string of numerals represents a number and omit leading zeroes.
my 2 cents,
anton -
SQL LOADER. Numeric values loaded as Varchar2 characters
Dear all,
please I need your help in this little problem . I am loading using SQL Loader a data file where a field X has a numeric value, and in the Control file it is defined as numeric value as well in the database table but the strange thing is that its values are loaded with the character "E15" at the end of each value.
The data files are extacted from AS400 , cobol system and loaded using SQL LOADER in he Oracle database 10g.
What could be the reason?
I appreciate your help very much , regardsWe can not guess as to what you data looks like nor can we guess as to what your control file indicates.
Post sufficient information for someone to help you.
PS: 10g is not a database version ... post the operating system and version information too:
SELECT * FROM v$version; -
Validating numeric value in a filename
I have a file and the filename should be like ABC_12345_RES_20150410.txt and i have to validate the filename.I am facing problem in validating the numeric value which can change and its length also can change.
I am using the following expression to validate whether its the numeric value /not:
(DT_I4)(SUBSTRING( @[User::FileName] ,FINDSTRING( @[User::FileName] ,"_", 1)+1, FINDSTRING( @[User::FileName] ,"_", 2)-FINDSTRING( @[User::FileName] ,"_", 1)-1)) == (DT_I4)(SUBSTRING( @[User::FileName]
,FINDSTRING( @[User::FileName] ,"_", 1)+1, FINDSTRING( @[User::FileName] ,"_", 2)-FINDSTRING( @[User::FileName] ,"_", 1)-1))
This statement is failing the package when i am entering a character instead of digit.. But i don't want the package to fail rather i just want to log the exception in this case.
Is there any other way to validate the numeric Value?
Many Thanks in Advance!Thanks a ton Martin for your advice.
I can do that but Actually the conversion is failing.. its giving error that cannot convert to (DT_I8). M looking for any other way to validate the numeric value. -
Looking for help with javascript to autofill checkboxes based on a numeric value.
I have a numeric field that I would like to have 1 - checkbox
out of five autofilled based on a numeric value.
For instance the numeric value is TotalPoints
If the TotalPoints Value is >10 autofill this checkbox
If the TotalPoints Value is 10 - 19 autofill this checkbox
If the TotalPoints Value is 20 - 49 autofill this checkbox
If the TotalPoints Value is 50 - 69 autofill this checkbox
If the TotalPoints Value is 70+ autofill this checkbox
Assistance in writing the correct script for this would be greatly appreciated.All the checkboxes have separate names.
Check box #1 is AssetClass.0 with the export value of 1
Check box #2 is AssetClass.1 with the export value of 2
Check box #3 is AssetClass.2 with the export value of 3
Check box #4 is AssetClass.3 with the export value of 4
Check box #5 is AssetClass.4 with the export value of 5
Score and StrategyUse the following calculation to determine your point score and indentify the appropriate strategy listed below.A. Add your points for questions 1 – 2.
B. Add your points for questions 3 – 12.
C. Subtract B from A. (Numeric Text Box) name is TotalPoints
Points Strategy Asset Class Mix (check boxes as named above)
0 – 10 Primarily Fixed Income: 80% Fixed Income; 20% Equity
10 – 19 Balanced Fixed Income-Oriented: 60% Fixed Income; 40% Equity
20 – 49 Balanced Equity-Oriented: 40% Fixed Income; 60% Equity
50 – 69 Primarily Equity: 20% Fixed Income; 80% Equity
70+ Equity: 95%; 5% Cash -
Popup Key LOV, NULL and "Invalid numeric value undefined for column"
Hello.
I've created an item based on database column of NUMBER type and set the following properties:
Display As = Popup Key LOV (Displays description, returns key value)
List of values definition=select 'display_value' d, 1 r from dual
Null display value=%
Null return value=
Display Null=Yes
When I select "%" in the LOV and try to apply changes to database I get error:
ORA-20001: Error in DML: p_rowid=1781, p_alt_rowid=N1, p_rowid2=, p_alt_rowid2=. ORA-20001: Invalid numeric value undefined for column N2
Error Unable to process row of table TTT.
If I set Display As = Select List, all works fine. But I need Popup Key LOV.
Could anybody help me?
I use Application Express 2.2.1.00.04Hi all,
I did my homework and solved this issue. First I would like to thank Patrick Wolf for the invaluable help he gives out on thread Re: Null value handling in LOVs The code presented here is just a minor edit to his code, but an essential one when dealing with Popup Key LOV items.
Here's what I did:
1. Create an Application Process.
Name: RemoveNulls
Sequence: 0
Point: On Submit: After Page Submission - Before Computations and Validations
Process Text:
BEGIN
FOR rItem IN
( SELECT ITEM_NAME
FROM APEX_APPLICATION_PAGE_ITEMS
WHERE APPLICATION_ID = TO_NUMBER(:APP_ID)
AND PAGE_ID IN (TO_NUMBER(:APP_PAGE_ID), 0)
AND LOV_DISPLAY_NULL = 'Yes'
AND LOV_DEFINITION IS NOT NULL
AND LOV_NULL_VALUE IS NULL
LOOP
IF (V(rItem.ITEM_NAME) = '%null' || '%' OR V(rItem.ITEM_NAME) = 'undefined')
THEN
Apex_Util.set_session_state(rItem.ITEM_NAME, NULL);
END IF;
END LOOP;
END;Error Message: #SQLERRM#Condition: None
2. You should be able to submit a Popup Key LOV with a NULL value now.
Once again, THANKS, Patrick! You rock! I'm seriously thinking of trying ApexLib now :)
Georger -
Get numerical values from 2D array of string
Hello!
I start by saying that I have a base knowledge of LabView. I'm using LabView 2011. I'm doing some communications test via Can-Bus protocol. As you can see in pictures of the block diagram and of the front panel that I've attached I'm using "Transmit Receive same Port" LabView example. It works very good but I would need to insert the 8 data bytes that I receive from the server in 8 different numerical variables so that I could use them to make some operations. How can I get numerical values from the 2D array of string that I attached?
Every example that you can provide is important!
Thank you very much!
Attachments:
1.jpg 69 KB
2.jpg 149 KBHi martiflix,
ehm: to unbundle data from a cluster I would use the function Unbundle(ByName)…
When you are new to LabVIEW you should take all the FREE online resources offered by NI on their website!
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome
Maybe you are looking for
-
Yeah. So. Basically what the giant-*** title that I didn't think was just a title said: Why should I have to create a new @icloud account? And how do I make my idiot phone not ask me to do so?
-
Problem with fonts while printing PDF in MAC OS
I have PDF file. It contains Cyrillic fonts and looks OK on the screen in MAC OS But during printing all labels are presented wrongly and not readable. I have tryied two options: 1) Opened PDF in built-in MAC OS Viewer 2) Downloaded and installed Acr
-
Xsl-fo template and pdf attachments
I'm using BI-Publisher and xsl-fo template to create my pdf reports. I need to attach a static pdf file to that report. Is that possible? I see it can be done using apache fop, how it can be done here? Thanks
-
Simple question. How do I change the setting on Firefox so when I drag a web address to my desktop, it shows the site's logo/icon? And how do I change all the existing shortcuts to reflect the logo/icons for those websites? Thanks!
-
Dear Experts, While creating SECATT (after completing recording....during parameterization), i am facing an error.... Screen Simulation : Wrong screen ID for simulator Data. plz guide .. Thanks DM