package components import ( "fmt" "git.ekzyis.com/ekzyis/delphi.market/types" "strconv" "math" ) templ MarketForm(m types.Market, outcome int, q types.MarketQuote, uQ int) {
} func formId(outcome int) string { return fmt.Sprintf("outcome-%d-form", outcome) } func inputId(outcome int) string { return fmt.Sprintf("outcome-%d-q", outcome) } func hxIndicator(outcome int) string { return fmt.Sprintf( "#%s>#p, #%s>#total, #%s>#reward", formId(outcome), formId(outcome), formId(outcome)) } func formatPrice(p float64, n int) string { if p == 0 || math.IsNaN(p) { return "0 sats" } return fmt.Sprintf("%v sats", strconv.FormatFloat(p, 'f', n, 64)) } func colorize(f float64) string { eps := 1e-5 if f-eps > 0 { return "text-success" } return "text-reset" }