I need to format a label value conditionally in "$K" and "$M" when the data is in thousands and millions. I've been using the following format which works absolutely fine in Excel cells ($#,##0.0,"K") and ($#,##0.00,,"M") respectively, this doesnt work when I use it to format a label caption using VBA with the following code :

```
lblInvestmentValue.Caption = Format(CStr(dblInvestmentVal), "[>=1000000] $#,##0.0,,""M"";[>0] $#,##0.0, ""K"";General")

```

On using this I get the following output

```
dblInvestmentVal Caption        Expected Caption
812              $812.0M        $812
8280119          $8,280,119.0M  $8.29M
91281            $12,367.0M     $12.4K

```

Any pointers