how to display a double UDF in the way we want?

Discuss problems installing or using TrackStudio.

how to display a double UDF in the way we want?

Postby fcai » Thu May 13, 2010 1:58 am

I have a double UDF (9, 2) which take user's input of purchase cost (money).

I wonder if there is a way to render it in the way we like?

i.e.
user enter: 1235.1
display:12345.10,

which adds a 0 to the end automatically.


Also I wonder if we can convert the number into the format of currency.

i.e.

user enter:12345.1
display:$12,345.10.


Thanks,

fred
fcai
 
Posts: 66
Joined: Wed Jun 24, 2009 10:57 pm
Location: USA

Re: how to display a double UDF in the way we want?

Postby Petr » Thu May 13, 2010 10:33 am

One way decide task used the script. Before create operation you need field check on the mask (^\d+.$\d+). next convert the number into the format of currency.
But field need type "String".
TS Support
email: parsentev@yandex.ru
Petr
 
Posts: 1125
Joined: Wed Aug 12, 2009 4:38 pm

Postby a-b-c » Thu May 13, 2010 11:17 am

Also there is a compromise: you can create a calculated string UDF, which would show the double value in a format you want. So you will have two UDFs, one for editing the raw value (private access, for internal usage) and one for displaying the formatted value (public access, for customers and other end users).
TrackStudio 4.0.14 x64
Windows SA + PostgreSQL 9.1
a-b-c
 
Posts: 548
Joined: Fri Jul 10, 2009 10:15 am
Location: Moscow, Russia

Re: how to display a double UDF in the way we want?

Postby fcai » Thu Jun 24, 2010 8:17 pm

thanks
fcai
 
Posts: 66
Joined: Wed Jun 24, 2009 10:57 pm
Location: USA


Return to TrackStudio Support

Who is online

Users browsing this forum: No registered users and 2 guests