Skip to main content

INCRBYFLOAT

Syntax

INCRBYFLOAT key increment

Module

generic

Categories

fast write

Description

Increments the floating point number stored at key by increment. If the key does not exist, it is set to 0 before performing the operation. An error is returned if the key contains a value of the wrong type or contains a string that can not be represented as a floating point number.

Options

Examples

Increment the value of the key mykey by 10.33:

db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
value, err := db.IncrByFloat("mykey", "10.33")