Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - Number Format in field
  FAQ FAQ  Forum Search   Register Register  Login Login


Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

Number Format in field

 Post Reply Post Reply
Author
Robert1977 View Drop Down
New Member
New Member


Joined: 05 Mar 2015
Location: Polska
Points: 12
Post Options Post Options   Quote Robert1977 Quote  Post ReplyReply Direct Link To This Post Topic: Number Format in field
    Posted: 18 Oct 2018 at 7:12am
Hi,
A would like to set this kind of format in number field: 
1 221,00  
1 546 684,54
154 879 884,00 etc.

I know one way:

event.value = util.printf("%,2.2f",event.value).toString().replace(/\./gim," ");

BUT if field is empty, it shows "0,00". I don't want to see "0,00" in empty fields, but just nothing. Could anybody help ?

Robert
Back to Top
Sponsored Links


Back to Top
BAlheit View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 1111
Post Options Post Options   Quote BAlheit Quote  Post ReplyReply Direct Link To This Post Posted: 18 Oct 2018 at 8:36am
Use something like this:

if (event.value != "") {
  if (event.value == 0)
    event.value = "";
  else
    event.value = util.printf("%,2.2f",event.value).toString().replace(/\./gim," ");
}
Back to Top
Robert1977 View Drop Down
New Member
New Member


Joined: 05 Mar 2015
Location: Polska
Points: 12
Post Options Post Options   Quote Robert1977 Quote  Post ReplyReply Direct Link To This Post Posted: 18 Oct 2018 at 7:12pm
THANK YOU VERY MUCH  !!! Handshake Thumbs Up
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.016 seconds.