Tag Info

Hot answers tagged

5

EDITED to include Mr.Wizard's replacement for Switch EDITED to cover additional cases Roll your own: quantityWithAppropriatePrefix[quant_Quantity] := Fold[UnitConvert[#1, #2] &, quant, {"Imperial", "SI"}]; quantityWithAppropriatePrefix /@ {Quantity[0.0000011, "Meter"], Quantity[0.0000033, "Feet"]} {Quantity[1.1, "Micrometers"], ...


4

I post this for illustrative purposes. You can access values. I suggest looking at the properties of your model, e.g. if your model is nlm then nlm["Properties"]. Some data and model: wd = WeatherData["Brisbane", "Temperature", {{2004, 1, 1}, {2013, 12, 31}, "Day"}]; vl = QuantityMagnitude /@ wd["Values"]; bnl = ...


3

Just a variant: qf[u_] := Module[{rng = Range[-24, 24, 3], multiplier = {"Yocto", "Zepto", "Atto", "Femto", "Pico", "Nano", "Micro", "Milli", "", "Kilo", "Mega", "Giga", "Tera", "Peta", "Exa", "Zetta", "Yatta"}, v, p}, v = QuantityMagnitude[u]; p = First@Nearest[rng, Log10[v]]; Quantity[ v 10^-p, (p /. Thread[rng -> multiplier]) ...



Only top voted, non community-wiki answers of a minimum length are eligible