Excel:...gZeros(3pm)

πŸ“¦
version 0.34 Β· 2 versions
  • 0.34 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.34 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Excel::Template::Container::KeepLeadingZeros ✨

okay bestie so the full name of this thing is Excel::Template::Container::KeepLeadingZeros β€” yes, that's a whole mouthful, it's giving "my parents named me after the family business" 😭 β€” and it lives in the User Contributed Perl Documentation corner of the perl world, section 3pm, iykyk. Let's get into it 🫢


πŸŽ€ PURPOSE πŸŽ€

So like, the whole point? It flips on the keep_leading_zeros flag ✨ for the worksheet it's chillin' inside, or for literally any worksheets that happen to be nested inside this node. That's it. That's the job. She's a one-trick pony and she ate πŸ’…


🌸 NODE NAME 🌸

KEEP_LEADING_ZEROS

that's the name you write in your template, no cap, all caps, exactly like that πŸ‘‘


πŸ¦‹ INHERITANCE πŸ¦‹

CONTAINER

she's a container girlie, she holds things, main character energy fr fr πŸ’œ


⭐ ATTRIBUTES ⭐

None. Zero. Nada. No attributes, no drama, she's low maintenance πŸ™ˆ


🌈 CHILDREN 🌈

None. (the node has no children, bestie β€” the worksheets are a different story, keep reading 😌)


πŸ”₯ EFFECTS πŸ”₯

It changes up how leading zeros get interpreted by Spreadsheet::WriteExcel. That's the whole vibe check right there ✨


πŸ’€ DEPENDENCIES πŸ’€

None. She's self-sufficient, a true independent icon πŸ‘‘


πŸ’… USAGE πŸ’…

so here's how you actually use her β€” two whole flavours, both iconic:

<worksheet>
  ... Cells here will NOT have leading-zeros preserved
  <keep_leading_zeros>
    ... Cells here will have leading-zeros preserved
  </keep_leading_zeros>
  ... Cells here will NOT have leading-zeros preserved
</worksheet>

<keep_leading_zeros>
  <worksheet>
    ... Cells here will have leading-zeros preserved
  </worksheet>
  <worksheet>
    ... Cells here will have leading-zeros preserved
  </worksheet>
</keep_leading_zeros>

see what she did there? 🧚 drop her inside a worksheet and she saves the zeros just for the cells in her lil bubble. Wrap her around whole worksheets and every worksheet inside gets the treatment. Both. Are. Valid. Periodt πŸ’–

heads up bestie: it's a container, so where you put it literally decides which cells get the leading-zeros-preserved life and which ones don't. Nest carefully, no cap πŸŽ€

πŸ“ AUTHOR πŸ“

Rob Kinyon (rob.kinyon@gmail.com) β€” ty for your service king 🫢


🌟 SEE ALSO 🌟

  • CELL
  • Spreadsheet::WriteExcel

and that's the whole page babes ✨ this lil doc came from perl v5.34.0, dated 2022-06-13, straight out of the User Contributed Perl Documentation collection πŸ’œ go forth and preserve those zeros, you absolute legend πŸ‘‘πŸŽ€

πŸ“¦ where this page comes from