Page Menu
Home
Code
Search
Configure Global Search
Log In
Files
F2126166
modifier.romanize.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
535 B
Subscribers
None
modifier.romanize.php
View Options
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifier
*/
use
Keruald\OmniTools\Culture\Rome\RomanNumerals
;
/**
* Smarty romanize modifier plugin
*
* Type: modifier<br>
* Name: romanize<br>
* Purpose: prints a number in roman
*
* @param int $
* @return string
*/
function
smarty_modifier_romanize
(
$number
)
:
string
{
try
{
return
RomanNumerals
::
fromHinduArabic
(
$number
);
}
catch
(
Throwable
$ex
)
{
// Not a strictly positive integer, don't modify
return
$number
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Sep 19, 01:51 (1 d, 4 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23667
Default Alt Text
modifier.romanize.php (535 B)
Attached To
rZED Zed
Event Timeline
Log In to Comment