Function Charge(ByVal Nights As Integer) As Single
'Dim NightsStayed As Integer
Dim cost As Single
If (Nights <= 7) Then
cost = CSng(Nights * 155.0)
If (Nights <= 14) Then
cost = CSng((7 * 155) + (Nights - 7) * 133.0)
cost = CSng((7 * 155.0) + (7 * 133.0) + (Nights - 14) * 120.0)
That's how it should be, right?
I tested it with TextBox1.Text = Charge(8).ToString("0.00") and the result was 1218.00 which is correct.
Now, where/how do you exactly get that ":=" ? Do you get it in VB.NET IDE i.e. editor while you write code or at the run time?
I don't see any problem neither in the way you call the function nor in the way you have declared the function parameter.
Only thing that came in to my mind was that you had declared "Nights" twice. That's possible by declaring it in two modules, but if you try to use "Nights" in a third module or in a form, you'll get an error stating that "Nights" is ambiguous. I also tried to switch Option Strict and Option Explicit settings Off but that had no effect. Finally, whatever I tried to do, I wasn't able to re-produce "Nights:=". I used VB.NET 2005. Not sure if there's something in the VB.NET 2008 what could do that. The only 'advice' I can give, is to search for the occurrences (declarations to be precise) of the "Nights" string. If you find it declared twice in your project, try to change other declaration to something else.
Anyway, never seen something like that and I wasn't able to re-produce it. Beats me up :D