You can use the Decimal.Parse()
or Decimal.TryParse()
method to convert a string to a decimal in C# as shown below:
main.cs414 chars18 lines
Decimal.TryParse()
method is recommended to use when converting strings to decimal to avoid throwing exceptions during parsing.
gistlibby LogSnag