Error First time I have encountered this

Var strTotalSale As String // These are declared earlier in the code stream...
Var curSale As Currency   

 If( strTotalSale.Left( 1 ).ToText = "$" ) Then
  Var i As Integer = strTotalSale.Length - 1
  curSale = strTotalSale.Right( i ).ToDouble
  curSale = strTotalSale.ToDouble
End If


It’s happening on the first line of the If statement. And I have used this many times before and never had an issue. I am using this to create an HTML doc that will be converted to PDF for printing but… this is just preparatory code that sets up a simple calculation.

May I ask why you need to convert it from String to Text?


As @Javier_Menendez implies, the conversion is unnecessary. But the error means that whatever source is loading strTotalSale is not setting the Encoding. You should fix that at the source.

If encodings are a mystery to you (as they are to many), I gave this presentation at an XDC that you might find helpful.


Ummm, because I am a derp… that’s the problem… isn’t it?

:joy: Sure you are not! :slight_smile: