<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Converting String to Double in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939414#M1210001</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Subhash,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i understood your requirement correctly, you want to convert String to double and want to set the String to your UI Element. If that is true,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use try, catch to convert string to double and after catch, you set your contest element.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try{&lt;/P&gt;&lt;P&gt;		&lt;/P&gt;&lt;P&gt;double d= Double.parseDouble("12a3");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}catch(NumberFormatException nfe){&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;wdComponentAPI.getMessageManager().reportSuccess("Exp Occured before");&lt;/P&gt;&lt;P&gt;wdContext.currentContest.setStringMsg("12a3");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope, it is working for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Oct 2007 17:32:30 GMT</pubDate>
    <dc:creator>sridhar_k2</dc:creator>
    <dc:date>2007-10-18T17:32:30Z</dc:date>
    <item>
      <title>Converting String to Double</title>
      <link>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaq-p/2939410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to convert a string to double as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;double d= Doubel.parseDouble(String)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but at runtime it is giving NumberFormatException ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how do we convert String to Double else....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be highly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2007 15:06:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaq-p/2939410</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-18T15:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String to Double</title>
      <link>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939411#M1209998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi! Subhash,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it's Double not Doubel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;following code is working fine..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;double d = Double.parseDouble("100");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Mithileshwar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2007 15:22:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939411#M1209998</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-18T15:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String to Double</title>
      <link>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939412#M1209999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Subhash,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your String is valid number as String, you can convert it to Double. If it contains other than numbers, you cannot conver it to Double.&lt;/P&gt;&lt;P&gt;ex: -&lt;/P&gt;&lt;P&gt;double d= Double.parseDouble("123");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can use like this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try{&lt;/P&gt;&lt;P&gt;double d= Double.parseDouble("123a");&lt;/P&gt;&lt;P&gt;}catch(NumberFormatException exp){&lt;/P&gt;&lt;P&gt;//throw erro.&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2007 16:18:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939412#M1209999</guid>
      <dc:creator>sridhar_k2</dc:creator>
      <dc:date>2007-10-18T16:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String to Double</title>
      <link>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939413#M1210000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello Sridhar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply. That was the problem.  But after getting through it and processing it I am trying to set the String to the Context Element which is tied to a UI Table field ...but does not make any difference ...when I try to debug it says that the String cannot be resolved..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking forward to your reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2007 17:05:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939413#M1210000</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-18T17:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String to Double</title>
      <link>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939414#M1210001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Subhash,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i understood your requirement correctly, you want to convert String to double and want to set the String to your UI Element. If that is true,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use try, catch to convert string to double and after catch, you set your contest element.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try{&lt;/P&gt;&lt;P&gt;		&lt;/P&gt;&lt;P&gt;double d= Double.parseDouble("12a3");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}catch(NumberFormatException nfe){&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;wdComponentAPI.getMessageManager().reportSuccess("Exp Occured before");&lt;/P&gt;&lt;P&gt;wdContext.currentContest.setStringMsg("12a3");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope, it is working for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2007 17:32:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939414#M1210001</guid>
      <dc:creator>sridhar_k2</dc:creator>
      <dc:date>2007-10-18T17:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String to Double</title>
      <link>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939415#M1210002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sridhar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am almost trying the same thing but if i put my last statement outside the Try it shows a compilation error and if I put inside it ...it does not do anything if I debug it ...at runtime it says "The String cannot be resolved"..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Looking forward to your reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2007 18:26:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939415#M1210002</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-18T18:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String to Double</title>
      <link>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939416#M1210003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Plz send me the code, after keeping it out side try / catch. Send me the error also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2007 19:04:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939416#M1210003</guid>
      <dc:creator>sridhar_k2</dc:creator>
      <dc:date>2007-10-18T19:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String to Double</title>
      <link>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939417#M1210004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Presumptions:&lt;/P&gt;&lt;P&gt;Context:&lt;/P&gt;&lt;P&gt;-quantity: String&lt;/P&gt;&lt;P&gt;-node: items&lt;/P&gt;&lt;P&gt;  *id&lt;/P&gt;&lt;P&gt;  *qty&lt;/P&gt;&lt;P&gt;  *price&lt;/P&gt;&lt;P&gt;  *total&lt;/P&gt;&lt;P&gt;View:&lt;/P&gt;&lt;P&gt;-Table.id: table - dataSource: items&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SRC:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;java.text.DecimalFormat df = new java.text.DecimalFormat("#,##0.00");
wdContext.nodeItems().invalidate();
try {
     // is quantity valid?
     double qty = Double.parseDouble(wdContext.currentContextElement().getQuantity());
     // valid quantity
     for(int i=0; i&amp;lt;10; i++) {
          IPublic&amp;lt;viewcontroller&amp;gt;.IItemsElement item = wdContext.nodeItems().createItemsElement();
          item.setId(String.valueOf(i+1));
          item.setQty(wdContext.currentContextElement().getQuantity());
          item.setPrice(df.format((i+1) * 1.0)); // *1.0... cast int to double
          item.setTotal(df.format(qty * (i+1)));
          wdContext.nodeItems().addElement(item);
     }
} catch(NumberFormatException nfe) {
     wdComponentAPI.getMessageManager().reportException(nfe, true);
}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;good luck...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Carlos Rojas Yasuda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2007 20:04:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939417#M1210004</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-18T20:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String to Double</title>
      <link>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939418#M1210005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sridhar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here you go:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try&lt;/P&gt;&lt;P&gt;     	{&lt;/P&gt;&lt;P&gt;     		&lt;/P&gt;&lt;P&gt;         	for(int i=0;i&amp;lt;str.length();i++)&lt;/P&gt;&lt;P&gt;     	{&lt;/P&gt;&lt;P&gt;     		char c =str.charAt(i);&lt;/P&gt;&lt;P&gt;     		if(c!=' '&amp;amp;&amp;amp; c&amp;lt;65)&lt;/P&gt;&lt;P&gt;     		final_str=final_str+c;&lt;/P&gt;&lt;P&gt;     	}&lt;/P&gt;&lt;P&gt;		double balance =Double.parseDouble(final_str);&lt;/P&gt;&lt;P&gt;		balance = balance + addition;&lt;/P&gt;&lt;P&gt;				String str2 = Double.toString(balance);&lt;/P&gt;&lt;P&gt;			&lt;/P&gt;&lt;P&gt;     	}&lt;/P&gt;&lt;P&gt;     	catch(Exception e)&lt;/P&gt;&lt;P&gt;     	{&lt;/P&gt;&lt;P&gt;     		e.printStackTrace();	&lt;/P&gt;&lt;P&gt;     	}&lt;/P&gt;&lt;P&gt;		&lt;/P&gt;&lt;P&gt;		wdContext.currentQuotasElement).setRest_Posted_Requested(str2);	&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It points to the last line saying str2 cannot be resolved ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking forward to your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     	&lt;/P&gt;&lt;P&gt;     }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        SubhashTripathi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2007 20:18:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939418#M1210005</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-18T20:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String to Double</title>
      <link>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939419#M1210006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Subhash,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The below code will work for you. String str2 was in side loop (local to the loop), it wont visible to the out of the loop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;String str2  = null;&lt;/P&gt;&lt;P&gt;try&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for(int i=0;i&amp;lt;str.length();i++)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;char c =str.charAt(i);&lt;/P&gt;&lt;P&gt;if(c!=' '&amp;amp;&amp;amp; c&amp;gt;&amp;lt;65)&lt;/P&gt;&lt;P&gt;final_str=final_str+c;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;double balance =Double.parseDouble(final_str);&lt;/P&gt;&lt;P&gt;balance = balance + addition;&lt;/P&gt;&lt;P&gt;str2 = Double.toString(balance);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;catch(Exception e)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;e.printStackTrace(); &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wdContext.currentQuotasElement).setRest_Posted_Requested(str2); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know, if it doesnt work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2007 21:19:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939419#M1210006</guid>
      <dc:creator>sridhar_k2</dc:creator>
      <dc:date>2007-10-18T21:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String to Double</title>
      <link>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939420#M1210007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sridhar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the code although it's changing the value according to my calculations still it doesen't change the value on the screen where I am trying for...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking forward to your reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2007 21:40:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939420#M1210007</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-18T21:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String to Double</title>
      <link>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939421#M1210008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure with your logic. You can print String before you set it to the Context.&lt;/P&gt;&lt;P&gt;like this,&lt;/P&gt;&lt;P&gt;Make sure your QuotasElement Cardinality 1.n.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;String str2 = null;&lt;/P&gt;&lt;P&gt;try&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for(int i=0;i&amp;lt;str.length();i++)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;char c =str.charAt(i);&lt;/P&gt;&lt;P&gt;if(c!=' '&amp;amp;&amp;amp; c&amp;gt;&amp;lt;65)&lt;/P&gt;&lt;P&gt;final_str=final_str+c;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;double balance =Double.parseDouble(final_str);&lt;/P&gt;&lt;P&gt;balance = balance + addition;&lt;/P&gt;&lt;P&gt;str2 = Double.toString(balance);&lt;/P&gt;&lt;P&gt;wdComponentAPI.getMessageManager().reportSuccess("str2  : "+str2 );&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;catch(Exception e)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;e.printStackTrace(); &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wdContext.currentQuotasElement().setRest_Posted_Requested(str2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2007 22:20:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939421#M1210008</guid>
      <dc:creator>sridhar_k2</dc:creator>
      <dc:date>2007-10-18T22:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String to Double</title>
      <link>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939422#M1210009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sridhar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I debug it I see the new value but some how it's not setting the Context Model attribute since it is a Model Attribute it does not have a cardinality property....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2007 22:28:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939422#M1210009</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-18T22:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String to Double</title>
      <link>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939423#M1210010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I Dont see any wrong in your code. I would check the value before setting it to the context element. Check in the rest of your program, any where you are setting it to null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check one more time, is it setting correct values like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;String str2 = null;&lt;/P&gt;&lt;P&gt;try&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for(int i=0;i&amp;lt;str.length();i++)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;char c =str.charAt(i);&lt;/P&gt;&lt;P&gt;if(c!=' '&amp;amp;&amp;amp; c&amp;gt;&amp;lt;65)&lt;/P&gt;&lt;P&gt;final_str=final_str+c;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;double balance =Double.parseDouble(final_str);&lt;/P&gt;&lt;P&gt;balance = balance + addition;&lt;/P&gt;&lt;P&gt;str2 = Double.toString(balance);&lt;/P&gt;&lt;P&gt;wdComponentAPI.getMessageManager().reportSuccess("str2 : "+str2 );&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;catch(Exception e)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;e.printStackTrace(); &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;wdContext.currentQuotasElement().setRest_Posted_Requested(str2);&lt;/P&gt;&lt;P&gt;wdComponentAPI.getMessageManager().reportSuccess("str2 : "+str2 );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you getting any exception, or is it setting null to your context element?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2007 03:55:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939423#M1210010</guid>
      <dc:creator>sridhar_k2</dc:creator>
      <dc:date>2007-10-19T03:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String to Double</title>
      <link>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939424#M1210011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sridhar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The statement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wdComponentAPI.getMessageManager().reportSuccess("str2 : "+str2 );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;prints the right modified value on the top but it's just not getting reflected in the Table field....and I am not setting it to null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        SubhashTripathi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2007 15:36:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939424#M1210011</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-19T15:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String to Double</title>
      <link>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939425#M1210012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Subhash,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not clear with your business logic. You want to convert String to Double, and you are converting that double value to String. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a Node - TestValueNode&lt;/P&gt;&lt;P&gt;                       - attribute1&lt;/P&gt;&lt;P&gt;                       - attribute2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;String str = "123";&lt;/P&gt;&lt;P&gt;String str2 = null;&lt;/P&gt;&lt;P&gt;double d = 0.0;&lt;/P&gt;&lt;P&gt; try{&lt;/P&gt;&lt;P&gt;   double d= Double.parseDouble(str); // this contains the double value&lt;/P&gt;&lt;P&gt;   str2 = Double.toString(d); // this contains the String value same as 'str'&lt;/P&gt;&lt;P&gt;   wdContext.currentTestValueNodeElement().setAttribute1(str2);&lt;/P&gt;&lt;P&gt; }catch(NumberFormatException nfe){&lt;/P&gt;&lt;P&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Write me back about your exact requirement. I can probably help you.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2007 20:02:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939425#M1210012</guid>
      <dc:creator>sridhar_k2</dc:creator>
      <dc:date>2007-10-19T20:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String to Double</title>
      <link>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939426#M1210013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No...No what I want to do is fetch a String from the Context ...convert it to a Double value ...perform some calculations on it ...convert it back to string again and set it to a context variable...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking forward to your reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2007 21:40:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939426#M1210013</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-19T21:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String to Double</title>
      <link>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939427#M1210014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assume you have a context value attribute called value of type String. You will read this String value&lt;DEL&gt;&amp;gt;Convert it to double&lt;/DEL&gt;&amp;gt;Perform an increment operation--&amp;gt;Convert back to String.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;String str = wdContext.currentContextElement().getValue();//eg."123"&lt;/P&gt;&lt;P&gt;double d = Double.parseDouble(str);// converted to 123.0&lt;/P&gt;&lt;P&gt;d = d+1;//124.0&lt;/P&gt;&lt;P&gt;wdContext.currentContextElement.setValue(Double.toString(d));//"124.0"&lt;/P&gt;&lt;P&gt;wdComponentAPI.getMessageManager().reportSuccess(wdContext.currentContextElement().getValue());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warm Regards,&lt;/P&gt;&lt;P&gt;Murtuza&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warm Regards,&lt;/P&gt;&lt;P&gt;Murtuza&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Oct 2007 05:49:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939427#M1210014</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-20T05:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String to Double</title>
      <link>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939428#M1210015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Murtuza,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply. I am also doing the same thing and when I try to print it ...it show me th eright value but when I set it to the Context variable ...it does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking forward to your reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2007 15:02:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939428#M1210015</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-22T15:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String to Double</title>
      <link>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939429#M1210016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Subhash,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are getting correct value in both places print 1 and print 2, check your table cell, whether it is correctly mapped to the context element or not? &lt;/P&gt;&lt;P&gt;If table cell is binded to the context element, it should show the value. there no other mistakes, i couldn't see in your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;String str = wdContext.currentContextElement().getValue();//eg.&lt;/P&gt;&lt;P&gt;wdComponentAPI.getMessageManager().reportSuccess(wdContext.currentContextElement().getValue()); - "123" -  &amp;lt;b&amp;gt;Print 1&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;double d = Double.parseDouble(str);// converted to 123.0&lt;/P&gt;&lt;P&gt;d = d+1;//124.0&lt;/P&gt;&lt;P&gt;wdContext.currentContextElement.setValue(Double.toString(d));//"124.0" &lt;/P&gt;&lt;P&gt;wdComponentAPI.getMessageManager().reportSuccess(wdContext.currentContextElement().getValue()); - &amp;lt;b&amp;gt;Print 2&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2007 15:27:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/converting-string-to-double/qaa-p/2939429#M1210016</guid>
      <dc:creator>sridhar_k2</dc:creator>
      <dc:date>2007-10-22T15:27:48Z</dc:date>
    </item>
  </channel>
</rss>

