C# -- Strip Decimal & Zero Fill
Imports System
Namespace StripDecimal_VB
Class RemoveDecimal
Shared Sub Main(ByVal args As String())
Dim testNum As Double = 255.95
Dim noDecimalVal As String = testNum.ToString().Replace(".", "").PadLeft(9, "0"c)
Console.WriteLine("Original Value: " + testNum.ToString())
Console.WriteLine("Value w/No Decimal: " + noDecimalVal)
End Sub
End Class
End Namespace
using System;
namespace StripDecimal_CS
{
class RemoveDecimal
{
static void Main(string[] args)
{
double testNum = 255.95;
string noDecimalVal = testNum.ToString().Replace(".", "").PadLeft(9, '0');
Console.WriteLine("Original Value: " + testNum.ToString());
Console.WriteLine("Value w/No Decimal: " + noDecimalVal);
}
}
}