Posted on: 12/29/2014 10:37:20 PM | Views : 772

We have an asp.net page where the code-behind is accumulating totals in a variable type = double.  After totaling, we need to write the total out in a string of 13 characters with dollars and cents combined.  For example, if the total came to 123456.78 we have to write it out as 12345678 (with leading zeros.  Below is my code line that I am using to grab dollars and cents and combine to a string. However, if the resulting total is in exact dollars with no cents (e.g. 123456) it does not pick up the correct dollars.  The variable cur41FedTax is a double data type.  I think it has something to do with the Fix() function.  I am open to suggestions for alternate to Fix().  Thanks.
        strDollars = Format(Fix(cur41FedTax), "0000000000000")         strCents = Right(CStr(Format(cur41FedTax, "#,###.00")), 2)      &n ...

Go to the complete details ...