001 /** 002 * Implements the Cold Fusion Function chr 003 */ 004 package railo.runtime.functions.string; 005 006 import railo.runtime.PageContext; 007 import railo.runtime.exp.ExpressionException; 008 import railo.runtime.ext.function.Function; 009 010 public final class Chr implements Function { 011 public static String call(PageContext pc , double number) throws ExpressionException { 012 int value=(int) number; 013 if(value<1){ 014 if(value==0)return ""; 015 //else { 016 throw new ExpressionException("Parameter 1 of function chr which is now ["+value+"] must be a non-negative integer"); 017 //} 018 } 019 return ""+(char)value; 020 } 021 }