starlit  Diff

Differences From Artifact [988785061c]:

To Artifact [9f5dd95326]:


    48     48   
    49     49   		if math.abs(val) > 1 then
    50     50   			if uncommonScales or cmaj then
    51     51   				local denom = 10^amt
    52     52   				local vd = val/denom
    53     53   				if prec then vd = lib.math.trim(vd, prec) end
    54     54   				if math.abs(val) >= (10^(amt)) then
    55         -					return string.format("%s %s%s",
    56         -						vd, (full and pmaj or smaj), unit)
           55  +					return string.format("%s%s%s",
           56  +						vd, (full and (' ' .. pmaj) or smaj), unit)
    57     57   				end
    58     58   			end
    59     59   		elseif math.abs(val) < 1 then
    60     60   			if uncommonScales or cmin then
    61     61   				local denom = 10^-amt
    62     62   				local vd = val/denom
    63     63   				if prec then vd = lib.math.trim(vd, prec) end
    64     64   				if math.abs(val) <= (10^-(amt-1)) then
    65         -					return string.format("%s %s%s",
    66         -						vd, (full and pmin or smin), unit)
           65  +					return string.format("%s%s%s",
           66  +						vd, (full and (' ' .. pmin) or smin), unit)
    67     67   				end
    68     68   			end
    69     69   		end
    70     70   	end
    71     71   
    72         -	return string.format("%s %s", val, unit)
           72  +	return string.format("%s%s", val, unit)
    73     73   end
    74     74   
    75     75   function fn.lerp(t, a, b) return (1-t)*a + t*b end
    76     76   
    77     77   function fn.trim(fl, prec)
    78     78   	local fac = 10^prec
    79     79   	return math.floor(fl * fac) / fac