Fix NumberFormatter::format for string values

The parameter type would be checked instead of the type after converting it to a number (toNumeric)
That would result in having a type of TYPE_DEFAULT instead of the derived type from the parameter hence always trying to format the Int64 value on strings

Also make NumberFormatter::create's third parameter optional.

Fixes  #3936