Hail, ye Monks!

I'm new to Catalyst and writing my first app. I'm querying my os for user disk quotas and then displaying them. I'm trying to figure out the appropriate place to put logic to convert the quota data from kilobytes to more friendly values. Here's what I'm talking about:

Sucky

LimitUsed
20000546

Better

LimitUsedUsed Percent
20 MB546 Kb03%

I get a hash from my model which contains block_curr,block_hard etc... in kilobytes, courtesy of Quota. I want to display in megabytes or gigabyes as appropriate and also show the percentage of used space. I do this now inside the controller, but that seems wrong to me. I feel like I should handle that inside my view, but I don't know how. I'm using Template Toolkit as my view, so I could do what I want with Template Toolkit plugins...

So! My question is, where is the right place in a Catalyst app to put this kind of view specific logic and how do I put it there? If there are any good articles discussing this, please point the way.

Thanks!
--Pileofrogs


In reply to Catalyst & Pretty Data by pileofrogs

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.