func (fc *FieldConfig) SetDecimals(v uint16) *FieldConfig {
	fc.Decimals = &v
	return fc
}
SetDecimals modifies the FieldConfig's Decimals property to
be set to v and returns the FieldConfig. It is a convenience function
since the Decimals property is a pointer.
package data
import (
	"fmt"
	"math"
	"strconv"
)
type FieldConfig struct {
	DisplayName string `json:"displayName,omitempty"`
	DisplayNameFromDS string `json:"displayNameFromDS,omitempty"`
	Path string `json:"path,omitempty"`
	Description string `json:"description,omitempty"`
	Filterable *bool `json:"filterable,omitempty"`
	Writeable *bool `json:"writeable,omitempty"`
	Unit     string       `json:"unit,omitempty"`      
	Decimals *uint16      `json:"decimals,omitempty"`  
	Min      *ConfFloat64 `json:"min,omitempty"`       
	Max      *ConfFloat64 `json:"max,omitempty"`       
	Mappings ValueMappings `json:"mappings,omitempty"`
	Thresholds *ThresholdsConfig `json:"thresholds,omitempty"`
	Color map[string]interface{} `json:"color,omitempty"`
	Links []DataLink `json:"links,omitempty"`
	NoValue string `json:"noValue,omitempty"`
	Custom map[string]interface{} `json:"custom,omitempty"`
}
const ExplicitNullValue = "null"
type ConfFloat64 float64
func (sf *ConfFloat64) MarshalJSON() ([]byte, error) {
	if sf == nil || math.IsNaN(float64(*sf)) || math.IsInf(float64(*sf), -1) || math.IsInf(float64(*sf), 1) {
		return []byte(string(ExplicitNullValue)), nil
	}
	return []byte(fmt.Sprintf(`%v`, float64(*sf))), nil
}
func (sf *ConfFloat64) UnmarshalJSON(data []byte) error {
	s := string(data)
	if s == string(ExplicitNullValue) {
		return nil
	}
	v, err := strconv.ParseFloat(s, 64)
	if err != nil {
		return err
	}
	cf := ConfFloat64(v)
	*sf = cf
	return nil
}