Javascript Zahlenformatierung - baseportal Forum - Web-Anwendungen einfach, schnell, leistungsfähig!
baseportal
English - Deutsch "Es gibt keine dummen Fragen - jeder hat einmal angefangen"

 baseportal-ForumDie aktuellsten 10, 30, 50, 100 Einträge anzeigen.  

 
 Ausgewählter Eintrag: Zur Liste 
    Beitrag von Marco (840 Beiträge) am Samstag, 5.Juni.2004, 11:27.
    Javascript Zahlenformatierung

      Ich habe einen vorgefertigtes cart system bekommen, welches ich nun verändern muß. Nun ist ein Problem mit der Zahlenformatierung entstanden. Die derzeitige Ausgabe ist z.B 31111.00 und sollte aber 31,111.00 sein. Ich finde weder sie Stelle, wo dies definiert wird noch den zu veränderten Parameter.

      Kann mir wer helfen ???

      Danke im Voraus für jede Hilfestellung, weil ich weiß nicht mehr weiter.

      MArco

      P.S.:

      Ich vermute das Problem in dieser Stelle, wobei es wirklich nur eine Vermutung ist.

      item_arr[itemn] = item;
      price_arr[itemn] = price;
      weight_arr[itemn] = weight;
      quantity_arr[itemn] = quantity;
      group_arr[itemn] = group;
      bill_item_ix[bill_ix] = itemn;
      itemn++;
      bill_arr1[bill_ix] = item;
      bill_arr2[bill_ix] = price;
      bill_arr3[bill_ix] = quantity;
      bill_arr4[bill_ix] = weight;
      bill_ix++;

      total_price=total_price+price*quantity;
      total_weight=total_weight+weight*quantity;

      // if (actual_deliverycost < min_delivery)
      // actual_deliverycost=min_delivery;
      // if (actual_deliverycost > max_delivery)
      // actual_deliverycost=max_delivery;

      if (total_price > free_delivery)
      
      actual_deliverycost=reduced_deliverycost;
      discountcheck(item,group,quantity);
      if (first_order==true && sw_delete == false)
      {first_order=false;
      
      toc.location.href='tool01.htm';
      }
      else toc.document.frm.basket.value=' '+round_amount(total_price);
      }
      }
      
      function send_order()
      {
      parent.content2.location.href='order01.htm';
      }
      
      function round_amount(amount)
      {
      var str = "" + Math.round(amount*100);
      var len = str.length;
      return (str=="0")?"0.00":(str.substring(0,len-2)+"."+str.substring(len-2,len));
      }
      
      function round_amount1(amount)
      {
      var string_amount = "";
      var decimal_sign;
      amount = parseFloat(amount);
      if (!(isNaN(amount)))
      {// round to nearest cent
      
      amount = Math.round(amount * 100);
      amount = amount / 100;
      string_amount = new String(amount);
      decimal_sign = string_amount.indexOf(".");
      if (decimal_sign == -1)
      {
      
      string_amount =string_amount+".00";
      }
      else
      { if (decimal_sign == (string_amount.length - 2)) {
      string_amount=string_amount+"0"; }
      }
      }
      else {
      string_amount = "0.00"; }
      return string_amount;}
      


    Antworten 
 Liste der Einträge von 30001 bis 30151:Einklappen Zur Eingabe 
Neueste Einträge << 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | Neuere Einträge < Zur Eingabe  > Ältere Einträge | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 >> Älteste Einträge


Zurück zur Homepage

© baseportal.de. Alle Rechte vorbehalten. Nutzungsbedingungen



powered in 0.10s by baseportal.de
Erstellen Sie Ihre eigene Web-Datenbank - kostenlos!