我刚刚开始使用RoR并修改现有程序。使用Ruby 2.2.2p95,Rails 4.1.13.rc1和Prawn 2.0.1 文本处于有界框中。在RoR文本输出中右对齐数字
pdf.column_box([0,pdf.cursor], :columns => 2, :width ==> pdf.bounds.width
person_text << "\n#{sprintf "%20d", count} #{'Grandchild'.pluralize(count)}"
如果count = 234,那么输出是:
234 Grandchildren
如果count = 4238,那么输出是:
4238 Grandchildren
没有填补空白的右对齐的数字一个20个空间场。输出应如下所示:
234 Grandchildren
4238 Grandchildren
什么是错? 如何编码?
问题与大虾。虾在前后剥去白色空间。输出位于左边缘并带有前导空白。 –