How can I format decimal values with next rules

```
0.12345    => 0.12
10.12345   => 10.12
100.12345  => 100.1
1000.12345 => 1,000

```

Please, notice that idea is to take the same space.
C style `printf` allows to do this using something `4.2%f` plus somehow thousands separator but I don't get how to reflect it in Cocoa.

**UPDATE**

If you didn't notice example says that `0.12345` transformed to `0.12` not to `0.1234`.