Viewing source for Recipe1605vb.aspx

<%@ Page %>
<script Language="vb" runat="server">
Private Sub Page_Load(sender As Object, e As System.EventArgs)
   ' formatting numbers
   Dim myDouble As Double = 123.456
   Dim myInt As Integer = 4567
   
   Response.Write((myDouble.ToString("C") & "<br>")) ' currency
   Response.Write((myInt.ToString("D") & "<br>")) ' decimal - use with int types
   Response.Write((myInt.ToString("D6") & "<br>")) ' decimal - zero padded to 6 digits
   Response.Write((myDouble.ToString("E") & "<br>")) ' scientific
   Response.Write((myDouble.ToString("F") & "<br>")) ' fixed-point
   Response.Write((myDouble.ToString("G") & "<br>")) ' general
   Response.Write((myDouble.ToString("G4") & "<br>")) ' general - 4 digits of accuracy
   Response.Write((myDouble.ToString("P") & "<br>")) ' percent
   Response.Write((myDouble.ToString("N") & "<br>")) ' number
   Response.Write((myDouble.ToString("R") & "<br>")) ' round-trip (re-castable back to a number)
   Response.Write((myInt.ToString("X") & "<br>")) ' hexadecimal - use with int types
End Sub 'Page_Load
</script>