Monday, March 13, 2006

VB.NET: Formatting for bytes with commas

Formatting for bytes with commas. For example 1,000 or 1,000,000. While this is really basic, I almost always forget this.

include_once('/home/rwmech/public_html/robsprogrammingjunk/geshi/geshi.php');

$source = <<'To format a number with commas
Format(intBytesProc, "#,##0")

END;

$geshi = new GeSHi($source, 'vbnet');
$geshi->set_header_type(GESHI_HEADER_DIV);
$geshi->set_overall_style('font-family: Courier New , Courier, Monospace; font-size: 8pt; word-wrap:break-word;');
$geshi->set_comments_style(1, 'color: #006600;');
$geshi->set_comments_style('MULTI', 'color: #006600;');
$geshi->set_header_content('Code Example © Robert Mech. May be used freely as long as credit is given to the source.');
$geshi->set_header_content_style('font-family: Verdana, Arial, sans-serif; color: #808080; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;');
$geshi->set_footer_content('If you use this code, please make a comment on the blog!');
$geshi->set_footer_content_style('font-family: Verdana, Arial, sans-serif; color: #808080; font-weight: bold; background-color: #f0f0ff; border-top: 1px solid #d0d0d0; padding: 2px;');

echo $geshi->parse_code();
?>

No comments: