Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Yes, i think there is some kind of bug in there, either a documentation bug, or implementation bug, or both

perl6form doesn't have an INTeger field, so  {0>>>>>} doesn't mean zero pad (that is only documented for decimal numbers ie floats)

Also, zero padding numeric fields only shows using {]].[[} not {>>.<<} so that could be a doc bug or implementation bug (not implemented, or error not detected)

So to fill that integer field with zeros you have to use lfill right before the value ... this works

#!/usr/bin/perl -- use strict; use warnings; use diagnostics; use Perl6::Form qw/ form /; print form { page => { width => ( 44 + 1), } }, "{<<{20}<<}|{>>>>>}", "Int for Zero Pad", {lfill => '0',} , 3 , "{<<{20}<<}|{]]].[[}", "Float for Zero Pad", 3.2, "{<<{20}<<}|{]]].[[0}", "Float for Zero Pad", 3.2, "{<<{20}<<}|{0]]].[[0}", "Float for Zero Pad", 3.2, ;;;;; __END__ Int for Zero Pad |0000003 Float for Zero Pad | 3.2 Float for Zero Pad | 3.2000 Float for Zero Pad |00003.2000

So maybe the implementation is incomplete, doesn't do the padding, or doesn't warn about invalid field pattern .... good job finding this AnaximanderThales


In reply to Re: Perl6::Form Issues with Zero-Padding and Declarative Width (integer) by Anonymous Monk
in thread Perl6::Form Issues with Zero-Padding and Declarative Width by AnaximanderThales

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2024-04-23 06:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found