Skip to content

Commit

Permalink
tpl/lang: Formally deprecate lang.NumFmt
Browse files Browse the repository at this point in the history
Use lang.FormatNumberCustom instead.
  • Loading branch information
jmooring authored and bep committed Sep 27, 2023
1 parent 75f56b4 commit 46da0b7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tpl/lang/lang.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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...)
}

Expand Down

0 comments on commit 46da0b7

Please # to comment.