garm/vendor/github.com/go-openapi/swag/conv/format.go
Gabriel Adrian Samfira 47537fb8b6 Update all dependencies
Update all deps.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2026-01-06 01:13:34 +02:00

28 lines
761 B
Go

// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0
package conv
import (
"strconv"
)
// FormatInteger turns an integer type into a string.
func FormatInteger[T Signed](value T) string {
return strconv.FormatInt(int64(value), 10)
}
// FormatUinteger turns an unsigned integer type into a string.
func FormatUinteger[T Unsigned](value T) string {
return strconv.FormatUint(uint64(value), 10)
}
// FormatFloat turns a floating point numerical value into a string.
func FormatFloat[T Float](value T) string {
return strconv.FormatFloat(float64(value), 'f', -1, bitsize(value))
}
// FormatBool turns a boolean into a string.
func FormatBool(value bool) string {
return strconv.FormatBool(value)
}