val

Converts numeric characters that occur at the beginning of a
string to a number. If conversion fails, returns zero.

val(String) → returns numeric

Argument Reference

String string
Required

A string or a variable that contains one

Examples
Sample code invoking the val function

val("120test12sstring");

Expected Result: 120

val("string98");

Expected Result: 0

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub