/// import { recipe, UI } from "commontools"; interface State { count: number; price: number; discount: number; quantity: number; } export default recipe("ArithmeticOperations", (state) => { return { [UI]: (

Basic Arithmetic

Count + 1: {state.count + 1}

Count - 1: {state.count - 1}

Count * 2: {state.count * 2}

Price / 2: {state.price / 2}

Count % 3: {state.count % 3}

Complex Expressions

Discounted Price: {state.price - (state.price * state.discount)}

Total: {state.price * state.quantity}

With Tax (8%): {(state.price * state.quantity) * 1.08}

Complex: {(state.count + state.quantity) * state.price - (state.price * state.discount)}

Multiple Same Ref

Count³: {state.count * state.count * state.count}

Price Range: ${state.price - 10} - ${state.price + 10}

), }; });