- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to convert String '1,700' to int 1700 by j...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2005 10:47 PM
12-20-2005 10:47 PM
How to convert String '1,700' to int 1700 by java?
Using 1000 separator, I will get the following error:
Exception in thread "main" java.lang.NumberFormatException: For input string: "1,700"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at bbb.main(bbb.java:15)
- Tags:
- Java
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2005 11:05 PM
12-20-2005 11:05 PM
Re: How to convert String '1,700' to int 1700 by java?
-Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2005 11:47 PM
12-20-2005 11:47 PM
Re: How to convert String '1,700' to int 1700 by java?
NumberFormat nf = NumberFormat.getNumberInstance();
Number n = null;
try {
n = nf.parse("1,700");
} catch (ParseException e) {
e.printStackTrace();
}
int i = n.intValue();
System.out.println("i = " + i);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2005 11:49 PM
12-20-2005 11:49 PM
Re: How to convert String '1,700' to int 1700 by java?
NumberFormat nf = NumberFormat.getNumberInstance();
Number n = null;
try {
n = nf.parse("1,700");
} catch (ParseException e) {
e.printStackTrace();
}
int i = n.intValue();
System.out.println("i = " + i);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2014 04:24 AM
07-06-2014 04:24 AM
Re: How to convert String '1,700' to int 1700 by java?
you can use number formater for this
Leslie