Skip to content

Instantly share code, notes, and snippets.

<cfscript>
//num = "1,234,567.89";
//num = "1.234.567,89";
//num = "1’234’567.89";
//num = "1 234 576.89";
//num = "1234567.89";
//num = "33";
num = "100.000,484389";
function standardiseDecimalNumber(num) {
<cfscript>
//num = "1,234,567.89";
//num = "1.234.567,89";
//num = "1’234’567.89";
//num = "1 234 576.89";
//num = "1234567.89";
//num = "33";
num = "100.000,484389";
function standardiseDecimalNumber(num) {
<cfscript>
//num = "1,234,567.89";
//num = "1.234.567,89";
//num = "1’234’567.89";
//num = "1 234 576.89";
//num = "1234567.89";
//num = "33";
num = "100.000,484389";
function standardiseDecimalNumber(num) {
<cfscript>
//num = "1,234,567.89";
//num = "1.234.567,89";
//num = "1’234’567.89";
//num = "1 234 576.89";
//num = "1234567.89";
//num = "33";
num = "100.000,484389";
function standardiseDecimalNumber(num) {
<cfscript>
//num = "1,234,567.89";
//num = "1.234.567,89";
//num = "1’234’567.89";
//num = "1 234 576.89";
//num = "1234567.89";
//num = "33";
if(len(num) > 2) {
if(num[len(num) - 2] == ",") {
<cfscript>
//num = "1,234,567.89";
//num = "1.234.567,89";
//num = "1’234’567.89";
//num = "1 234 576.89";
//num = "1234567.89";
num = "33";
if(len(num) > 2) {
if(num[len(num) - 2] == ",") {
<cfscript>
//num = "1,234,567.89";
//num = "1.234.567,89";
//num = "1’234’567.89";
//num = "1 234 576.89";
//num = "1234567.89";
if(num[len(num) - 2] == ",") {
num = replace(num, ".", "", "all");
num = replace(num, ",", ".", "all");
<cfoutput>
<cfset local.jSONdata = {} />
<cfparam name="arguments.jSONvariable" default="getDictionaryItems.CancellationPuntos.msg_cancellationPuntosIneligible">
<cfloop index="local.idx_jSON" list="#arguments.jSONvariable#" delimiters=".">
<cfset local.jSONdata = local.jSONdata[local.idx_jSON] />
</cfloop>
</cfoutput>
<cfdump var="#replaceList(local.jSONdata, "","", "|", true)#">
<cfscript>
num1 = "1.234.567,90";
rNum = reverse(num1);
for(i=1; i<len(rnum); i++){
if(!isNumeric(rNum[i])){
decimalSeparator = rNum[i];
break;
}
}
<cfscript>
BankAccount = "1234567890, Mallesh Boya, 9000495994"
</cfscript>
<cfoutput>
Account Number = <b>#ListGetAt(BankAccount, 1)#</b></br>
Customer Name = <b>#ListGetAt(BankAccount, 2)#</b></br>
Mobile Number = <b>#ListGetAt(BankAccount, 3)#</b>
</cfoutput>