Link to home
Start Free TrialLog in
Avatar of Member_2_4426104
Member_2_4426104

asked on

help formating double

Hi,
I have the below code.

How do I format the p.value so its stays a double and can be sorted in my listview but shows:

$#,##.##

Thanks
T
Function getPrice(ByVal query As XElement, ByVal vehicleValue As String) As Double
 
    			Dim priceResult = From p In query...<price> _
                      			Where p.@vehicle = vehicleValue _
                      			Select Double.Parse(p.Value)
 
    			Return priceResult.FirstOrDefault()
		End Function

Open in new window

Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

If you format a number, the results will always be a String.

Wayne
tubbs is right. Sorting numbers continues to be harder than it should be. Take a look at this article on ICompare.

http://madebits.com/articles/numsort/index.php
ASKER CERTIFIED SOLUTION
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial