internal/number: implement more formatting

- simplified API
   - use MinExpDigits to determine whether to use
     scientific or decimal.
   - test added to verify that this is correct.
- reuse percent pattern for permille:
  - use DigitShift instead of Multiplier
- added support for padding
- copy Pattern, instead of using pointer, to allow
- small fix for quoting.

Change-Id: Ib83ab28f2cad57e90d73bb30b346ab7845a56333
Run-TryBot: Marcel van Lohuizen <>
TryBot-Result: Gobot Gobot <>
Reviewed-by: Nigel Tao <>
6 files changed