Forum: Ruby on Rails How I get zerofill field?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
daniel.koch (Guest)
on 2005-11-23 17:42
(Received via mailing list)
How I get zerofill field?
I'm getting the value, but with no zeroes.

Thanks a lot.

--
Daniel K.
daniel.koch (Guest)
on 2005-11-23 18:14
(Received via mailing list)
Solved!
value.to_s.rjust(limit, '0')

Thanks nobody!

On 11/23/05, Daniel K. <removed_email_address@domain.invalid> wrote:
> How I get zerofill field?
> I'm getting the value, but with no zeroes.
>
> Thanks a lot.
>
> --
> Daniel K.
>


--
Daniel K.
This topic is locked and can not be replied to.