Published in: ASP
|
|
|
URL: http://reusablecode.blogspot.com/2008/08/roman-numerals-part-3.html
Handles arabic numbers larger than 4999. Requires my roman() function.
Expand |
Embed | Plain Text
<% ' Copyright (c) 2008, reusablecode.blogspot.com; some rights reserved. ' ' This work is licensed under the Creative Commons Attribution License. To view ' a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or ' send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California ' 94305, USA. ' Convert Arabic numerals into Roman numerals. ' REQUIRES: roman() function bigroman(ByVal arabic) dim thousands thousands = Array("", "M", "MM", "MMM", "M(V)", "(V)", "(V)M", "(V)MM", "(V)MMM", "M(X)") if arabic >= 10000 then bigroman = "(" & roman((arabic - (arabic mod 10000)) / 1000) & ")" arabic = arabic mod 10000 end if bigroman = bigroman & thousands((arabic - (arabic mod 1000)) / 1000) arabic = arabic mod 1000 bigroman = bigroman & roman(arabic) ' Convert parentheses to <span> tags. bigroman = replace(bigroman, "(", "<span style=""text-decoration: overline"">") bigroman = replace(bigroman, ")", "</span>") end function %>
You need to login to post a comment.