quantity
a number with a unit
1# quantity: a number with a unit25 km3# a unit power45 m25 m^2Example outputCtrl+Enter to run
syntax
Section titled “syntax”1# to converts25 km to mi3.10686 mi3# * and / combine the units4100 km / 2 h50 km/hExample outputCtrl+Enter to run
Functions that take it
Section titled “Functions that take it”floatconvert to a floatfracshow a number as a fraction, like 7/2, or as text rounded to the nearest 1/den, like “2 11/16 in”rangethe integers from 0 up to n, or from a up to b, not including the end, or with a step the numbers or quantities betweenabsthe value without its sign, so -3 becomes 3roundround to the nearest whole number, or to digits decimal placessiground to that many significant figures (digits counted from the first non-zero one)floorround down to a whole numberceilround up to a whole numbertruncdrop the fractional part, rounding toward zerosign-1 if x is negative, 0 if it’s zero, 1 if it’s positivehypotthe length of the long side of a right triangle with sides x and y, sqrt(x² + y²)sumadd up a list, units includedavgthe mean (average), or with weights, the mean where each item counts as many times as its weightproductmultiply all the items togethermedianthe middle value once sorted, or with an even count, halfway between the middle twovariancehow spread out the numbers arestdevhow spread out the numbers are, in the same units as themgeo_meanthe geometric mean: the nth root of the product, the right average for growth factorsharmonic_meanthe harmonic mean: the reciprocal of the average reciprocal, the right average for ratesrmsthe root mean square: the square root of the average of the squaresmadthe median absolute deviation: the median distance from the median, a spread that outliers barely movesemthe standard error of the mean: the standard deviation divided by the square root of the countiqrthe interquartile range: the 75th percentile minus the 25thsinthe sine of an angle, in radians or an angle unitcosthe cosine of an angle, in radians or an angle unittanthe tangent of an angle, in radians or an angle unitatan2the angle from the positive x axis to the point (x, y), from -180° to 180°cscthe cosecant of an angle, 1 / sin(x)secantthe secant of an angle, 1 / cos(x), not to be confused withsecfor secondscotthe cotangent of an angle, 1 / tan(x)fixedx as text with exactly that many decimals, padding with zeros if neededscix as text in scientific notation, like 1.23e5 for 123000, with digits decimalsengx as text in engineering notation, with the exponent a multiple of 3, like 123.457e6, with digits decimalsmixed_fraca number as a mixed fraction text, like “1 1/4” for 1.25, optionally rounded to the nearest 1/denpercenta fraction as percentage text, so 0.256 is “25.6%”, with digits decimalscommasx as text with commas between thousands, like “1,234,567”, with digits decimalshuman_bytesa number of bytes as text in the largest binary unit that fits, like “117.7 MiB”, with one decimaldmsan angle as degrees, arcminutes and arcseconds text, like 52°20′24″lata latitude in degrees as text with N or S, like 7°19′48″Slona longitude in degrees as text with E or W, like 74°0′21″Wsimplifythe quantity in the prefix of its unit that reads best, like 3.6 kW instead of 3600 Wsithe quantity in standard metric (SI) unitskindthe kind of quantity, like length or force, or its SI units when the kind has no namefor_scalethe quantity in whichever informal unit gives the easiest number to picturebmibody mass index, mass divided by the square of height, in kg/m²salarya pay rate as pay per hour, day, week, month and yeargrowwhat money will be worth after time at the ratepresent_valuewhat a future sum, and any regular payments up to then, are worth today at the rateaprthe yearly rate quoted before compounding (annual percentage rate) that gives an effective yearly ratenpvthe net present value of a list of cash flows: each is discounted by the rate for every period since the first, which is nowloan_ratethe yearly rate of a loan from its monthly payment (the annual percentage rate, compounding monthly)depreciationa schedule of how an asset loses value over its life, a row per yearcagrthe steady yearly growth rate that would take start to end over time (compound annual growth rate)doublinghow long it takes money to double at the rateapythe yearly rate you really earn once compounding is included (annual percentage yield)real_ratewhat a return is really worth once inflation is taken outpaymentthe monthly payment that pays off a loan over time, interest includedpayoffhow long a regular payment takes to pay off a balance with interest, rounded up to whole paymentsamortizea loan’s month-by-month schedulesharesplit a sum into parts, in equal shares or by the weights in a list, rounded to the cent so they still add up exactlychangehow much a value changed, as a fraction of where it startedmarginprofit as a fraction of the selling pricemarkupprofit as a fraction of what it cost youpartsa duration split into the largest units that fit, up to three of days, hours, minutes and secondshmsa duration as clock text, like 7:15:00, with hours that can pass 24depth_of_fieldthe zone that looks sharp: {near, far, total, hyperfocal}, for lens focal length at aperture f focused at dist
Example results generated on 2026-11-04. Ones using now, today or randomness will differ when you run them.