<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    App::VitaminUtils - Utilities related to vitamins

VERSION
    This document describes version 0.002 of App::VitaminUtils (from Perl
    distribution App-VitaminUtils), released on 2020-11-03.

DESCRIPTION
    This distributions provides the following command-line utilities:

    *   convert-vitamin-a-unit

    *   convert-vitamin-d-unit

    *   convert-vitamin-e-unit

FUNCTIONS
  convert_vitamin_a_unit
    Usage:

     convert_vitamin_a_unit(%args) -&gt; [status, msg, payload, meta]

    Convert a vitamin A quantity from one unit to another.

    Examples:

    *   Show all possible conversions:

         convert_vitamin_a_unit(quantity =&gt; "mcg");

        Result:

         [
           200,
           "OK",
           [
             { amount =&gt; 0.001, unit =&gt; "mg" },
             { amount =&gt; 1, unit =&gt; "mcg" },
             { amount =&gt; 1, unit =&gt; "mcg-all-trans-retinol" },
             {
               amount =&gt; 12.000000048,
               unit   =&gt; "mcg-dietary-all-trans-beta-carotene",
             },
             { amount =&gt; 23.999999808, unit =&gt; "mcg-alpha-carotene" },
             { amount =&gt; 23.999999808, unit =&gt; "mcg-beta-cryptoxanthin" },
             {
               amount =&gt; 2,
               unit   =&gt; "mcg-all-trans-beta-carotene-as-food-supplement",
             },
             { amount =&gt; 3.33333333333333, unit =&gt; "IU" },
             { amount =&gt; 3.33333333333333, unit =&gt; "IU-retinol" },
             { amount =&gt; 1.66666666666667, unit =&gt; "IU-beta-carotene" },
           ],
           {},
         ]

    *   Convert from mcg to IU (retinol):

         convert_vitamin_a_unit(quantity =&gt; "1500 mcg", to_unit =&gt; "IU"); # -&gt; [200, "OK", 5000, {}]

    *   Convert from mcg to IU (retinol):

         convert_vitamin_a_unit(quantity =&gt; "1500 mcg", to_unit =&gt; "IU-retinol"); # -&gt; [200, "OK", 5000, {}]

    *   Convert from mcg to IU (beta-carotene):

         convert_vitamin_a_unit(quantity =&gt; "1500 mcg", to_unit =&gt; "IU-beta-carotene"); # -&gt; [200, "OK", 2500, {}]

    *   Convert from IU to mg:

         convert_vitamin_a_unit(quantity =&gt; "5000 IU", to_unit =&gt; "mg"); # -&gt; [200, "OK", 1.5, {}]

    If target unit is not specified, will show all known conversions.

    This function is not exported.

    Arguments ('*' denotes required arguments):

    *   quantity* =&gt; *str*

    *   to_unit =&gt; *str*

    Returns an enveloped result (an array).

    First element (status) is an integer containing HTTP status code (200
    means OK, 4xx caller error, 5xx function error). Second element (msg) is
    a string containing error message, or 'OK' if status is 200. Third
    element (payload) is optional, the actual result. Fourth element (meta)
    is called result metadata and is optional, a hash that contains extra
    information.

    Return value: (any)

  convert_vitamin_d_unit
    Usage:

     convert_vitamin_d_unit(%args) -&gt; [status, msg, payload, meta]

    Convert a vitamin D quantity from one unit to another.

    Examples:

    *   Show all possible conversions:

         convert_vitamin_d_unit(quantity =&gt; "mcg");

        Result:

         [
           200,
           "OK",
           [
             { amount =&gt; 1, unit =&gt; "mcg" },
             { amount =&gt; 0.001, unit =&gt; "mg" },
             { amount =&gt; 40, unit =&gt; "IU" },
           ],
           {},
         ]

    *   Convert from mcg to IU:

         convert_vitamin_d_unit(quantity =&gt; "2 mcg", to_unit =&gt; "IU"); # -&gt; [200, "OK", 80, {}]

    *   Convert from IU to mg:

         convert_vitamin_d_unit(quantity =&gt; "5000 IU", to_unit =&gt; "mg"); # -&gt; [200, "OK", 0.125, {}]

    If target unit is not specified, will show all known conversions.

    This function is not exported.

    Arguments ('*' denotes required arguments):

    *   quantity* =&gt; *str*

    *   to_unit =&gt; *str*

    Returns an enveloped result (an array).

    First element (status) is an integer containing HTTP status code (200
    means OK, 4xx caller error, 5xx function error). Second element (msg) is
    a string containing error message, or 'OK' if status is 200. Third
    element (payload) is optional, the actual result. Fourth element (meta)
    is called result metadata and is optional, a hash that contains extra
    information.

    Return value: (any)

  convert_vitamin_e_unit
    Usage:

     convert_vitamin_e_unit(%args) -&gt; [status, msg, payload, meta]

    Convert a vitamin E quantity from one unit to another.

    Examples:

    *   Show all possible conversions:

         convert_vitamin_e_unit(quantity =&gt; "mg");

        Result:

         [
           200,
           "OK",
           [
             { amount =&gt; 1, unit =&gt; "mg" },
             { amount =&gt; 1000, unit =&gt; "mcg" },
             { amount =&gt; 1, unit =&gt; "mg-alpha-tocopherol-equivalent" },
             { amount =&gt; 1, unit =&gt; "mg-rrr-alpha-tocopherol" },
             { amount =&gt; 1, unit =&gt; "mg-rrr-alpha-tocopherol" },
             { amount =&gt; 2, unit =&gt; "mg-beta-tocopherol" },
             { amount =&gt; 10, unit =&gt; "mg-gamma-tocopherol" },
             { amount =&gt; 3.33333333333333, unit =&gt; "mg-alpha-tocotrienol" },
             { amount =&gt; 1.49253731343284, unit =&gt; "IU" },
             { amount =&gt; 1.49253731343284, unit =&gt; "IU-natural" },
             { amount =&gt; 1.11111111111111, unit =&gt; "IU-synthetic" },
           ],
           {},
         ]

    *   Convert from mg to IU (d-alpha-tocopherol/natural vitamin E):

         convert_vitamin_e_unit(quantity =&gt; "67 mg", to_unit =&gt; "IU"); # -&gt; [200, "OK", 100, {}]

    *   Convert from mg to IU (d-alpha-tocopherol/natural vitamin E):

         convert_vitamin_e_unit(quantity =&gt; "67 mg", to_unit =&gt; "IU-natural"); # -&gt; [200, "OK", 100, {}]

    *   Convert from mg to IU (dl-alpha-tocopherol/synthetic vitamin E):

         convert_vitamin_e_unit(quantity =&gt; "90 mg", to_unit =&gt; "IU-synthetic"); # -&gt; [200, "OK", 100, {}]

    *   Convert from IU to mg:

         convert_vitamin_e_unit(quantity =&gt; "400 IU", to_unit =&gt; "mg"); # -&gt; [200, "OK", 268, {}]

    If target unit is not specified, will show all known conversions.

    This function is not exported.

    Arguments ('*' denotes required arguments):

    *   quantity* =&gt; *str*

    *   to_unit =&gt; *str*

    Returns an enveloped result (an array).

    First element (status) is an integer containing HTTP status code (200
    means OK, 4xx caller error, 5xx function error). Second element (msg) is
    a string containing error message, or 'OK' if status is 200. Third
    element (payload) is optional, the actual result. Fourth element (meta)
    is called result metadata and is optional, a hash that contains extra
    information.

    Return value: (any)

HOMEPAGE
    Please visit the project's homepage at
    &lt;https://metacpan.org/release/App-VitaminUtils&gt;.

SOURCE
    Source repository is at
    &lt;https://github.com/perlancar/perl-App-VitaminUtils&gt;.

BUGS
    Please report any bugs or feature requests on the bugtracker website
    &lt;https://rt.cpan.org/Public/Dist/Display.html?Name=App-VitaminUtils&gt;

    When submitting a bug or request, please include a test-file or a patch
    to an existing test-file that illustrates the bug or desired feature.

SEE ALSO
    Physics::Unit

AUTHOR
    perlancar &lt;perlancar@cpan.org&gt;

COPYRIGHT AND LICENSE
    This software is copyright (c) 2020 by perlancar@cpan.org.

    This is free software; you can redistribute it and/or modify it under
    the same terms as the Perl 5 programming language system itself.

</pre></body></html>