# HG changeset patch # User Chris Cannam # Date 1393951616 0 # Node ID 77ada441f95a2c35bb57950ea11620f3db8733ee # Parent 0ebf2a6a83eeab33cb881b75d772c7be11e65922 Formatting diff -r 0ebf2a6a83ee -r 77ada441f95a src/may/matrix.yeti --- a/src/may/matrix.yeti Mon Mar 03 09:20:18 2014 +0000 +++ b/src/may/matrix.yeti Tue Mar 04 16:46:56 2014 +0000 @@ -880,9 +880,12 @@ [ "\nColumns \(c0) to \(c1)\n", (map do row: map do v: - //!!! not right -- want to round to 1dp of exp notation if less than 1e-4 - n = mm.round (v * 100000); - strPad ' ' 10 "\(n / 100000)"; + strPad ' ' 10 + (if abs v >= 1000.0 or abs v < 0.01 then + String#format("%.2E", [v as ~Double]) + else + String#format("%5f", [v as ~Double]) + fi); done (vec.list row) |> strJoin ""; done (asRows (columnSlice m c0 (c1 + 1))) |> strJoin "\n") ];