Exportar a excel numeros separados por puntos

Exportar a excel numeros separados por puntos

cridaEngocridaEngo Posts: 1Questions: 0Answers: 0

Tengo un Problema, quiero exportar a Excel una tabla en La cual tengo una columna con números separados por punto "." pero al momento de exportarla no se exportan los números correctamente

y al exportar se ve así:

yo quiero que el resultado sea el siguiente:

adjunto caso de prueba: https://jsfiddle.net/CridaEngo/21nwLc7p/10/

Replies

  • rf1234rf1234 Posts: 2,906Questions: 87Answers: 414

    These number seem to have thousand separators as periods.
    -3.600 and 100.000.00

    They also seem to have a decimal point.
    This number doesn't make a lot of sense to me:
    55.00.00
    The first period is neither a thousand separator nor a decimal point.

    This looks much better:
    55.000,00 and -3,6
    That would be a period as a thousand separator and a decimal comma.
    That is the standard in many European countries.

    If you want both, thousand separators and decimals, as periods that sounds interesting. Is that the standard in your country? Is your local Excel version set to this? If so you should be able to do this. If not: You could only export your numbers as strings because Excel wouldn't know how to deal with them.

    Before I can help you more this would need to be clarified.

  • rf1234rf1234 Posts: 2,906Questions: 87Answers: 414
    edited February 1

    Just tried your example. Your exported data indicate that your local Excel installation has similar conventions as mine: Decimal coma and periods as thousand separators.

    This is what it looks like for me. If I had an American Excel version it would look different of course: Excel is usually interpreting the stuff you are exporting. In my case Excel only thinks that -3,6 is a number. And that is correct: in my country the other "numbers" don't make sense. Hence Excel interprets them as strings.

    You are speaking of

    números separados por punto "."

    Does that mean that "55", "00" and "00" are three separate numbers?

    If you want formatted numbers you can follow this thread:
    https://datatables.net/forums/discussion/77996/more-flexibel-excel-export#latest

    The trick is:
    - you pass the numbers to Excel as "neutral" as possible. Just like Javascript numbers: No thousand separators and just one point per number which must be the decimal point.
    - Then you tell Excel how to format that number: With or without thousand separators, with a minimum of two decimal places even if zero etc.
    - Then Excel will use the thousand separators of its regional setting and also the right decimal sign (comma or period) for your region.

Sign In or Register to comment.