diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-02-20 09:15:11 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-02-20 09:15:11 +0100 |
commit | 4d9e079e826c9b51b610260564111fa8385f7581 (patch) | |
tree | 13a4e3a16efd510b3b15a2ce55cf3caeb00857aa /pager.c | |
parent | Merge branch 'zj/term-columns' (diff) | |
parent | make lineno_width() from blame reusable for others (diff) | |
download | git-4d9e079e826c9b51b610260564111fa8385f7581.tar.xz git-4d9e079e826c9b51b610260564111fa8385f7581.zip |
Merge branch 'zj/decimal-width'
* zj/decimal-width:
make lineno_width() from blame reusable for others
Conflicts:
cache.h
pager.c
Diffstat (limited to 'pager.c')
-rw-r--r-- | pager.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -147,3 +147,15 @@ int term_columns(void) return term_columns_at_startup; } + +/* + * How many columns do we need to show this number in decimal? + */ +int decimal_width(int number) +{ + int i, width; + + for (width = 1, i = 10; i <= number; width++) + i *= 10; + return width; +} |