From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750974AbcEGTY3 (ORCPT ); Sat, 7 May 2016 15:24:29 -0400 Received: from one.firstfloor.org ([193.170.194.197]:37199 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750883AbcEGTY2 (ORCPT ); Sat, 7 May 2016 15:24:28 -0400 Date: Sat, 7 May 2016 12:24:25 -0700 From: Andi Kleen To: Jiri Olsa Cc: Andi Kleen , acme@kernel.org, peterz@infradead.org, jolsa@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 06/10] perf, tools, stat: Avoid fractional digits for integer scales Message-ID: <20160507192425.GA13997@two.firstfloor.org> References: <1462489447-31832-1-git-send-email-andi@firstfloor.org> <1462489447-31832-7-git-send-email-andi@firstfloor.org> <20160507191038.GH19977@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160507191038.GH19977@krava> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > if (csv_output) { > > - fmt = sc != 1.0 ? "%.2f%s" : "%.0f%s"; > > + fmt = floor(sc) != sc ? "%.2f%s" : "%.0f%s"; > > } else { > > if (big_num) > > - fmt = sc != 1.0 ? "%'18.2f%s" : "%'18.0f%s"; > > + fmt = floor(sc) != sc ? "%'18.2f%s" : "%'18.0f%s"; > > else > > - fmt = sc != 1.0 ? "%18.2f%s" : "%18.0f%s"; > > + fmt = floor(sc) != sc ? "%18.2f%s" : "%18.0f%s"; > > how about the rest of the code? we display % also in print_running > and print_noise_pct functions and maybe some place else For those it doesn't matter. In fact it's probably better there to always show the fractions. It is just confusing for metrics. -Andi