How to use Decimal format specifier and fixed point specifier together on a double variable


I have 2 questions.

  1. In the screenshot below, acnum is an object[ .]array while val1 is a double variable. I’m trying to convert acnum(0) item into “00000.00” format and thrown with an error.

  2. How to get the features of
    " acnum(0).tostring(“D5”) " --//I understand this works only for INT
    As well as
    acnum(0).tostring(“F2”,CultureInfo.InvariantCulture) together?

What is the fundamental piece of understanding that I am missing here. Any help appreciated.

PS: The screenshot attached is just a test file. Actually I’ll be passing the array argument from another xaml.

Hi @SudhakarAs92
Buddy you were almost right, but need small correction
At last the writeline activity must be mentioned like this
String.Format("{0:00}", acnum(0))

And the reason why this didn work is, it should be in This format

For more info on how to use it

Try with this and let know buddy
Cheers @SudhakarAs92

Thanks for the response!

String.Format("{0:F2}",acnum(0)) solved my query partially though…

Meanwhile, the below line worked for me satisfying both the formats that i needed.


If there are any other efficient way to achieve this, do share. Thankz!


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.