DataTable.render.number

DataTable.render.number

PabloCamaraPabloCamara Posts: 16Questions: 4Answers: 0

hola , tengo un pequeño problema en la forma en que se muestran los importes en la pantalla . esta es la definicion de los campos

    { data: "Limit_Facility_Ccy"                ,title:'Limite Credito'                     ,type:'num', render: DataTable.render.number(',','.',2,''),className:'text-right'},
    { data: "Limit_Available_Facility_Ccy"      ,title:'Credito Disponible'                 ,type:'num', render: DataTable.render.number(',','.',2,''),className:'text-right'},

en la pantalla se muestra numeros exponenciales cuando se trata de importes en divisa.

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    This is expected. The default number renderer will show anything over 100000000000 as an exponential number. See the code here.

    If that isn't what you want, don't use the default number renderer. You could create your own with the default code, just removing the exponential part.

    Allan

  • PabloCamaraPabloCamara Posts: 16Questions: 4Answers: 0

    algun ejemplo disponible ?

  • kthorngrenkthorngren Posts: 21,333Questions: 26Answers: 4,951
    Answer ✓
  • PabloCamaraPabloCamara Posts: 16Questions: 4Answers: 0

    resuelto , muchas gracias

        render: function (data, type, row) {
            data = Number(data);
            return data.toLocaleString('en-US',{ minimumFractionDigits: 2 })
          }},
    
Sign In or Register to comment.