Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to check if the string's format is alphabetical or numeric
#6
Solved: 11 Years, 3 Months, 3 Weeks ago
Just change "CLng()" to "CDbl()" It will work for both "123,123" and "123,123.21"

QTP Code Wrote:str_Value = "123,123.21"

If IsNumeric(str_Value) Then
___str_Value = FormatNumber(CDbl(str_Value), 2)
End If
MsgBox str_Value

Although, I would argue that "123,123.21" is already formatted the way you want it, so running it through the above code is really unnecessary, but if you don't know the format at runtime, I guess this approach should be fine.
Reply


Messages In This Thread
RE: how to check if the string's format is alphabetical or numeric - by cdesserich - 10-07-2010, 08:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to change 24 hrs time format to 12 hrs time format Varsha Gupta 1 2,814 04-21-2018, 11:06 AM
Last Post: Ankur
  How to validate a format of an alphanumeric string PrateepKaraval 2 5,986 11-08-2014, 10:26 AM
Last Post: vinod123
  Unable to read numeric values from WebTable into Datatable Akhila 2 4,695 11-26-2013, 03:43 PM
Last Post: Akhila
  Pdf to Excel or any other Format Conversion branjitk 1 2,468 06-14-2012, 08:14 AM
Last Post: basanth27
  How to extract numeric values hamzaz 3 3,860 04-26-2012, 03:15 PM
Last Post: ssvali

Forum Jump:


Users browsing this thread: 1 Guest(s)