Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
9

Establecer formato por Javascript

Community Beginner ,
Jun 12, 2023 Jun 12, 2023

Hola

Tengo un formulario en el que en un campo he puesto la validación de formato siguiente en (Formato-->Personalizar-->Secuencia de comandos de formato personalizada)

if (!event.value) {
event.value = "KILOGRAMOS";
event.target.display = display.noPrint;
} else {
event.target.display = display.visible;
}

El problema es que necesito que tenga formato numérico con . separador de miles y sin decimales pero no me deja poner el formato numerico al estar el formato personalizar. ¿Como se podría hacer por Javascript añadiendolo al script actual?

TOPICS
How to , JavaScript , PDF forms
421
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Beginner ,
Jun 12, 2023 Jun 12, 2023
LATEST

OK he encontrado la solución por si le sirve a alguien

if (!event.value) {

    event.value = "KILOGRAMOS";

    event.target.display = display.noPrint;

} else {

    event.target.display = display.visible;

    event.value = util.printf("%,0d", event.value).replace(/,/g, ".");

}

 

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 12, 2023 Jun 12, 2023
LATEST

OK he encontrado la solución por si le sirve a alguien

if (!event.value) {

    event.value = "KILOGRAMOS";

    event.target.display = display.noPrint;

} else {

    event.target.display = display.visible;

    event.value = util.printf("%,0d", event.value).replace(/,/g, ".");

}

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines