1 2 3 4 5 6 7 8
c := NewContext() var fahrenheit Cell centigrade := c.NewSettableFormula(0.0, func() interface{} { return (fahrenheit.Value().(float64) - 32.0) * (5.0 / 9.0) }) fahrenheit = c.NewSettableFormula(32.0, func() interface{} { return (centigrade.Value().(float64) * (9.0/5.0)) + 32.0 })
You can clone a snippet to your computer for local editing. Learn more.