Gamestudio Links
Zorro Links
Newest Posts
COT Download with Quandl does not work
by Petra. 11/15/25 09:35
Training with the R bridge does not work
by Petra. 11/15/25 09:31
Zorro 2.70
by jcl. 11/15/25 08:43
Camera always moves upwards?
by NeoDumont. 11/14/25 16:32
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
Alpaca Plugin v1.4.0
by TipmyPip. 10/20/25 18:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (AndrewAMD), 9,391 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
tritom, sheliepaley, Blueguy, blobplayintennis, someone2
19178 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Change digits format #316314
03/23/10 09:48
03/23/10 09:48
Joined: Apr 2008
Posts: 144
Germany | Niedersachsen (Lower...
Roxas Offline OP
Member
Roxas  Offline OP
Member

Joined: Apr 2008
Posts: 144
Germany | Niedersachsen (Lower...
Hey

I want to know if it is possible to change the format of the digits while running.

I have a Panel that shows item amounts with 14 digit elements on it.

now i want it that way that if there are actual more than zero items of one kind that the digits will be shown. if not, they shouldn't.

to solve this i wanted to change the format of the digits.
if there are more than zero items the format should be something like "%02.0f"; if not it should be just "" or something like this, so that the numbers are invisible.

Is this even possible?
pan_setvar didn't help me.

greetings

Re: Change digits format [Re: Roxas] #316326
03/23/10 11:20
03/23/10 11:20
Joined: Mar 2009
Posts: 88
Walori Offline
Junior Member
Walori  Offline
Junior Member

Joined: Mar 2009
Posts: 88
You can change the format of the strings by simple string coding:
(yes, all you need is a string)
Code:
PANEL* your_pan =
{
//Your stufff here
//Example digits:
digits(0,0,digit_format,NULL,1,variable);
}

STRING* digit_format = "%.0f";//Let's put it first this way
function change_digits(PANEL*panel,STRING* new_digits)
{
//Just a check if your panel is valid
if(panel == NULL)
{
return 0
}
str_cpy(digit_format,"");//Clear existing format
str_cpy(digit_format,new_digits);//And add new format to the string
return 1;

}



That's basicly how you can do it, when you add more complexity (ie need some text before format and so on) look for more str commands in the manual.

Re: Change digits format [Re: Walori] #316328
03/23/10 11:24
03/23/10 11:24
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
You can use 'pan_setdigits' to change digit parameters at runtime.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1