Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

What to add to convert string to decimal

$
0
0
I know almost nothing about Visual Basic. So question may be stupid.
I have this code

Function FederalRate(TaxableAmount As String) As Long
If TaxableAmount > 0 And TaxableAmount < 2150 Then
FederalRate = 0
        
ElseIf TaxableAmount >= 2150 And TaxableAmount < 10850 Then
FederalRate = 0.1
    
ElseIf TaxableAmount >= 10851 And TaxableAmount < 37500 Then
FederalRate = 0.15
        
End If
 
End Function




In output need: if TaxableAmount is for example 5000, then need to display FederalRate 0.1. However I get 0.

What need to add to the code above to convert string to decimal (to get displayed 0.1 instead of 0)?

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>