(arg ref.Val, locale string)
| 229 | } |
| 230 | |
| 231 | func formatDecimal(arg ref.Val, locale string) (string, error) { |
| 232 | switch arg.Type() { |
| 233 | case types.IntType: |
| 234 | argInt, ok := arg.ConvertToType(types.IntType).Value().(int64) |
| 235 | if !ok { |
| 236 | return "", fmt.Errorf("could not convert \"%s\" to int64", arg.Value()) |
| 237 | } |
| 238 | return fmt.Sprintf("%d", argInt), nil |
| 239 | case types.UintType: |
| 240 | argInt, ok := arg.ConvertToType(types.UintType).Value().(uint64) |
| 241 | if !ok { |
| 242 | return "", fmt.Errorf("could not convert \"%s\" to uint64", arg.Value()) |
| 243 | } |
| 244 | return fmt.Sprintf("%d", argInt), nil |
| 245 | default: |
| 246 | return "", decimalFormatError(runtimeID, arg.Type().TypeName()) |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | func matchLanguage(locale string) (language.Tag, error) { |
| 251 | matcher, err := makeMatcher(locale) |
no test coverage detected