Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I am wanting to receive an XML String field with a decimal in it and add it to another XML string field with a decimal value in it. However, during type conversion the decimal positions are truncated if they are zero, this is not desirable.
for example. String 100.00 + String 120.00 = 220.00
Return val As Decimal produces 220I am very new to working with .net and was wondering if someone could tell me the proper way to code this snippet. I am getting an error "Format not declared"
Public Function Reformat(ByVal val1 As Decimal) As Decimal
Dim val2 As Decimal = Format(val1,"##0.00")
Return val2
End FunctionI am using this code inside of a Biztalk functoid in a map between a string input and string output and simply want the decimal places to appear.
thanks

Dim val2 As Decimal = Format(val1,"##0.00")
When you apply formatting, it's no longer a number. val1 should be a String.I am getting an error "Format not declared"
Try using:
Microsoft.VisualBasic.Strings.Format
It's the Format function you're looking for with its explicit location.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |