Code first.
taxRateDecimal = 0.0765;
if (taxRateDecimal.ToString().Split('.').Length == 2)
{
outPut = taxRateDecimal.ToString().Split('.')[1].Substring(0, 4);
ReportParameters.Add("TaxRateAsDecimal", "." + outPut);
}
As you can see in the substring I have to hard code my length of 4. Desired results .0765 as a string.
Here are some scenarios I have gone through.
I have a percent of 7.65. I want to convert this to decimal, when doing so I do 7.65 / 100. this gives me 0.0765, but I want just .0765. If I take 0.0765 and use a split on "." and use length ect.. I actually get for the array [1] a length of 6 and a value of 076500. Again I only want .0765 or just 0765 and I can add the dot.
Any other ideas that I have not tried? This will eventually need to be a string since I am passing it in as a prama into SSRS.