cancel
Showing results for 
Search instead for 
Did you mean: 

Error: Conversion from string "0.5" to type 'Single' is not valid.

shahariar_k_bhu
Level 5
Hello, I'm currently experiencing some problems when using decimals in Blue Prism. Blue Prism understands the following syntax for Numbers: "0.5". This variable is often used when I have timers. For example "Wait for 0.5 seconds". However, when closing the business object, and then reopening, I often get the error stated in the Subject title. "Error: Conversion from string "0.5" to type 'Single' is not valid.". I have to manually open the XML file, and change the value from 0.5 to 0,5. This changes the value inside the business object, so I end up with a Number value of 0,5 = 5. Why does this keep happening? How can I solve this issue?
7 REPLIES 7

John__Carter
Staff
Staff
This might have something to do with the number format setting (ie the locale) of the PC itself - it seems there is confusion with whether a comma represents a decimal point or a separator.

shahariar_k_bhu
Level 5
@bastian.bezeme I thought so, but somehow the issue popped up again. I realized that I had three different regions (norwegian, finnish, en-US), so I changed everthing to en-UK except my keyboard. Let's see if the problem occurs. My plan is to use your crazy idea with the calculation formula from the Init page or the corresponding pages. @John Carter Yeah, I just realized that I used three kind of regions somehow. I've changed to the default enligsh UK now except my keyboard, let's see if it solves the problem.

@shabhu It is related directly to region, decimal separator to be precise, in en-USi it will be dot and in european regions it will be comma. Problem lays in xml of process/business where camera position information are stored as floats. This results in exception when trying to parse that numbers as separator is not valid.

shahariar_k_bhu
Level 5
@jbany Thanks! How can I work around this problem? I currently use en-UK, which is supposed to use dot. However, then I'm not able to read the numbers as they need comma, giving me problems with the camera position. Should I just swap to a region which uses comma?

RobinToll
Staff
Staff
That seems like a reasonable step to try.

@shabhu Either, you can swap regions or if you are familliar with XML format you can export Business Object to XML, and change separator in tags related to camera position and import it back again.

@jbany That's what I've been doing to fix this problem, but the problem shouldn't occur in the first place. I haven't met this problem for a few days now. The weird thing is that region and locale settings for Blue Prism V4.2 should be set to english-UK, but decimals in english-UK have a dot, and not comma. However, in BP, decimals switch between dot and comma.