Skip to content

Commit 9e329e8

Browse files
authored
Compact number printing in tables in the manual (#619)
* Use compact printing for numbers in tables * Correct grammar * Remove irrelevant remark
1 parent 220fa74 commit 9e329e8

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

docs/src/logarithm.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,7 @@ Mathematical operations are forwarded to the logarithmic part, so that for examp
233233
for convenience, though the association is understood (e.g. `s^-1*(3dBm) == (3dBm)/s`).
234234

235235
The behavior of multiplication is summarized in the following table, with entries marked by
236-
† indicate prohibited operations. This table is populated automatically whenever the docs
237-
are built.
236+
† indicating prohibited operations.
238237

239238
```@eval
240239
using Latexify, Unitful
@@ -244,7 +243,7 @@ quantities = uparse.(head)
244243
tab = fill("", length(head), length(head))
245244
for col = eachindex(head), row = 1:col
246245
try
247-
tab[row, col] = string(quantities[row] * quantities[col])
246+
tab[row, col] = sprint(show, quantities[row] * quantities[col], context = :compact => true)
248247
catch
249248
if quantities[row] === u"1/Hz" && quantities[col] === u"3dB"
250249
tab[row, col] = "† ‡"
@@ -328,8 +327,7 @@ julia> 20u"dBm" + @dB 1u"W"/u"W"
328327
i.e. `1.1 W`.
329328

330329
Rules for addition are summarized in the following table, with entries marked by †
331-
indicating prohibited operations. This table is populated automatically whenever the docs
332-
are built.
330+
indicating prohibited operations.
333331

334332
```@eval
335333
using Latexify, Unitful
@@ -339,7 +337,7 @@ quantities = uparse.(head)
339337
tab = fill("", length(head), length(head))
340338
for col = eachindex(head), row = 1:col
341339
try
342-
tab[row, col] = string(quantities[row] + quantities[col])
340+
tab[row, col] = sprint(show, quantities[row] + quantities[col], context = :compact => true)
343341
catch
344342
tab[row, col] = "†"
345343
end

0 commit comments

Comments
 (0)