Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 christophebrock
		
			christophebrockHello,
I'm looking for the format pattern to convert a number into a number with a decimal, but only when the value goes below 1.
So for example:
10
8
3
1
0,9
0,3
Anyone has an idea?
Kind regards,
Christophe
 
					
				
		
.png) hic
		
			hic
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Try
Num(Number,If(Number>=1,'0','0.0'),'.',',') as FormattedNumber
HIC
 
					
				
		
.png) hic
		
			hic
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		...or with decimal comma:
Num(Number,If(Number>=1,'0','0,0'),',','.') as FormattedNumber
 Chanty4u
		
			Chanty4u
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		try this
aa:
LOAD * INLINE [
sam, F2
10
8
3
1
0, 9
0
];
LOAD
if(sam<1,'0','0.0') as new
Resident aa;
 christophebrock
		
			christophebrockThanks but I'm having these numbers generated in a barchart by selecting "Relative" (so I'm getting the percentages).
I want to format that "generated" number, as the load script doesn't work for me.
 
					
				
		
.png) hic
		
			hic
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		You can use the formula I suggested as expression in the bar chart:

 
					
				
		
.png) hic
		
			hic
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		But you may need to create the "relative" part inside your formula, e.g.

 christophebrock
		
			christophebrockThanks, seems legit, but there's no easy formatting shortcode that can be used?
 
					
				
		
.png) hic
		
			hic
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Unfortunately not...
 christophebrock
		
			christophebrockOk, thanks for all the help !!
