Posted By

rtipton on 06/07/09


Tagged

decimal VBNet


Versions (?)

Strip Decimal and Zero Fill


 / Published in: VB.NET
 

  1. Imports System
  2. Namespace StripDecimal_VB
  3. Class RemoveDecimal
  4. Shared Sub Main(ByVal args As String())
  5. Dim testNum As Double = 255.95
  6. Dim noDecimalVal As String = testNum.ToString().Replace(".", "").PadLeft(9, "0"c)
  7.  
  8. Console.WriteLine("Original Value: " + testNum.ToString())
  9. Console.WriteLine("Value w/No Decimal: " + noDecimalVal)
  10. End Sub
  11. End Class
  12. End Namespace

Report this snippet  

You need to login to post a comment.