func FormatValue(format string, val interface{}) string {
	switch typed := val.(type) {
	case bool:
		if format == "%d" {
			if typed {
				return "1"
			}
			return "0"
		}
	case float64:
		switch {
		case strings.HasSuffix(format, "m"): // milli
			format = format[:len(format)-1]
			val = typed * 1e3
		case strings.HasSuffix(format, "k"): // kilo
			format = format[:len(format)-1]
			val = typed / 1e3
		}
	case time.Duration:
		val = typed.Round(time.Second)
	}

	if format == "" {
		format = "%v"
	}

	return fmt.Sprintf(format, val)
}
// FormatValue will apply specific formatting in addition to standard sprintf
FormatValue will apply specific formatting in addition to standard sprintf
// FormatValue will apply specific formatting in addition to standard sprintf
func FormatValue(format string, val interface{}) string {
	switch typed := val.(type) {
	case bool:
		if format == "%d" {
			if typed {
				return "1"
			}
			return "0"
		}
	case float64:
		switch {
		case strings.HasSuffix(format, "m"): 
			format = format[:len(format)-1]
			val = typed * 1e3
		case strings.HasSuffix(format, "k"): 
			format = format[:len(format)-1]
			val = typed / 1e3
		}
	case time.Duration:
		val = typed.Round(time.Second)
	}
	if format == "" {
		format = "%v"
	}
	return fmt.Sprintf(format, val)
}
func FormatValue ( format string , val interface { } ) string { switch typed := val . ( type ) { case bool : if format == " " { if typed { return " " } return " " } case float64 : switch { case strings . HasSuffix ( format , " " ) : format = format [ : len ( format ) - 1 ] val = typed * 1e3 case strings . HasSuffix ( format , " " ) : format = format [ : len ( format ) - 1 ] val = typed / 1e3 } case time . Duration : val = typed . Round ( time . Second ) } if format == " " { format = " " } return fmt . Sprintf ( format , val ) }
FormatValue will apply specific formatting in addition to standard sprintf
FormatValue will apply specific formatting in addition to standard sprintf
// milli // kilo