tpl/lang: Formally deprecate lang.NumFmt

Use lang.FormatNumberCustom instead.
This commit is contained in:
Joe Mooring 2023-09-26 14:04:01 -07:00 committed by Bjørn Erik Pedersen
parent 75f56b4ce6
commit 46da0b7aaa

View file

@ -28,6 +28,7 @@ import (
"github.com/gohugoio/hugo/common/hreflect"
"github.com/gohugoio/hugo/deps"
"github.com/gohugoio/hugo/helpers"
"github.com/spf13/cast"
)
@ -240,10 +241,9 @@ func (ns *Namespace) FormatNumberCustom(precision, number any, options ...any) (
return string(b), nil
}
// NumFmt is deprecated, use FormatNumberCustom.
// We renamed this in Hugo 0.87.
// Deprecated: Use FormatNumberCustom
// Deprecated: Use lang.FormatNumberCustom instead.
func (ns *Namespace) NumFmt(precision, number any, options ...any) (string, error) {
helpers.Deprecated("lang.NumFmt", "Use lang.FormatNumberCustom instead.", false)
return ns.FormatNumberCustom(precision, number, options...)
}