![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Nov 2007
Posts: 388
Thanks: 0
Thanked 0 times in 0 posts
|
Hi,
I'm getting an "Input string was not in a correct format" error for the following: String textX = value2.ToString(); textX = textX.Substring(0); textX=textX.Insert(2, "."); PREFIX = double.Parse(textX); It is the last line causing the error (PREFIX = double.Parse(textX). The data for "value2" is simply price data in formats such as: 5408, 5397, 5400, 5398, 5402, etc...could the error be caused by trying to place the "." after "even" values such as the "5400"...since the trailing zeros will be dropped? |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
Please consult the standard MS docs on .NET coding issues.
Also: - you might consider printing out textX to monitor the actual content. - decimal sign might be dependent on actual country/language settings of your PC. Please consult the MS docs for e.g. numeric formatting issues related.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Nov 2007
Posts: 388
Thanks: 0
Thanked 0 times in 0 posts
|
Thank you for the reply.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Gui.Design.DisplayName string? | NinjaCustomer | Indicator Development | 2 | 02-19-2008 10:46 PM |
| Wizard Problem with String Parameter | zoltran | General Programming | 1 | 12-17-2007 07:23 AM |
| Formatting string number | MAX | General Programming | 6 | 10-13-2007 11:20 AM |
| Function int NTFilled(string orderId) | HelloHello | Automated Trading | 1 | 08-29-2007 02:40 AM |
| How to increment string? | Richard Von | Indicator Development | 1 | 07-30-2007 07:16 AM |