Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,955 questions

51,897 answers

573 users

How to convert decimal to double in VB.NET

2 Answers

0 votes
Imports System

Public Class Program
    Public Shared Sub Main()
        Dim dec1 As Decimal = 87236.908D
        Dim dec2 As Decimal = 0.43071D
        Dim dec3 As Decimal = -7612.8702D
		
        Dim d1 As Double = Decimal.ToDouble(dec1)
        Dim d2 As Double = Decimal.ToDouble(dec2)
        Dim d3 As Double = Decimal.ToDouble(dec3)
		
        Console.WriteLine(d1)
        Console.WriteLine(d2)
        Console.WriteLine(d3)
    End Sub
End Class



' run:
'
' 87236.908
' 0.43071
' -7612.8702
'

 



answered Jun 3, 2023 by avibootz
0 votes
Imports System

Public Class Program
	Public Shared Sub Main()
        Dim x As Decimal = 21672.747D
        
		Dim d As Double = CDbl(x) / 20.0R
		
        Console.Write(d)
    End Sub
End Class




' run:
'
' 1083.63735
'

 



answered Jun 3, 2023 by avibootz

Related questions

1 answer 182 views
182 views asked Nov 15, 2021 by avibootz
3 answers 165 views
1 answer 114 views
1 answer 115 views
1 answer 112 views
1 answer 88 views
1 answer 111 views
111 views asked Nov 15, 2021 by avibootz
...