CoCalc -- Collaborative Calculation in the Cloud
Sharedsupport / 2017-01-01-194021-html.sagewsOpen in CoCalc

Examples for support purposes...

h = sage.misc.html.HTMLFragmentFactory()
a = h('<b>x</b>')
<b>x</b>
a = h(2/3)
<script type="math/tex">\frac{2}{3}</script>
def scinot(x,ndp):
    string="%."+str(ndp)+"e"
    base, expo = (string % x).split('e')
    return '{0}&#215;10<sup>{1}</sup>'.format(base,int(expo))
html(scinot(332413.4959494995, 3))
3.324×105