Category talk:Wren-fmt: Difference between revisions

Content deleted Content added
PureFox (talk | contribs)
→‎Source code: Some minor improvements.
PureFox (talk | contribs)
→‎Source code: Changes to complex number formatting.
Line 481:
}
 
// Applies the 'fm' and 'f' formatformats respectively to each component, x and y, of a complex number 'n'
// complex number 'n' before joining them together in the form x ± yi.
static z(w, n, p) {
if (n is Num) return f(w, n, p)
if (n.type.toString != "Complex") Fiber.abort("Argument must be a complex or real number.")
var real = ffm(w, n.real, p)
var sign = (n.imag >= 0) ? " + " : " - "
var imag = f(w, n.imag.abs, p)
if (w < 0) imag = imag.trimEnd(" ")
return real + sign + imag + "i"
}
Return to "Wren-fmt" page.