Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, July 5, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Format currency to 4 decimal places when creating datagrid through code
SLX_Novice
Posts: 246
 
Format currency to 4 decimal places when creating datagrid through codeYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Jun 11 2:12 PM
fiogf49gjkf0d

Hi all.


SLX LAN v7.2.1


I'm creating a datagrid using code and I want to know how I can round my currency field to 4 decimal places. Below is the code I'm using to make the column into currency but how do I make it so it rounds to 4 decimal places instead of 2 (default).


Thank you in advance!


            Set col = .Add(0)
             col.FieldName ="Carrier_Price"

             col.Caption = "Carrier Price" 

             col.Readonly = True
             col.FormatType = ftCurrency
             col.Width = 70
             col.Alignment = 2
             col.HeaderAlignment = 2
[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Format currency to 4 decimal places when creating datagrid through codeYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Jun 11 2:37 PM
fiogf49gjkf0d
Search this forum (modify opportunity products) - but it's something like .DecimalPlaces = 4. It'll be posted under my name so might be able to locate that way (not on my machine at moment).
[Reply][Quote]
SLX_Novice
Posts: 246
 
Re: Format currency to 4 decimal places when creating datagrid through codeYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Jun 11 4:16 PM
fiogf49gjkf0d

Thanks for the reply Mike.


 


I looked for "modify opportunity products" in the Scripting & Customization forum but couldn't find any thread where the decimal places for ftCurrency is set. I also tried your suggestion of .DecimalPlaces = 4 and that didn't work it gave me an error.

[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Format currency to 4 decimal places when creating datagrid through codeYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Jun 11 4:20 PM
fiogf49gjkf0d
Try looking through some of SLX code - especially around manage products. It's in there somewhere.
[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Format currency to 4 decimal places when creating datagrid through codeYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Jun 11 4:09 AM
fiogf49gjkf0d

Yep, definitely was that:


 


            col.DecimalPlaces = 4 '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
            col.DisplayFormat = ",0.0000;-,0.0000"  'DNL '<<<<<<<<<<<<<<<<<<<<<<


 


Mike


 

[Reply][Quote]
SLX_Novice
Posts: 246
 
Re: Format currency to 4 decimal places when creating datagrid through codeYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Jun 11 1:25 PM
fiogf49gjkf0d

I tried using col.DecimalPlaces but I got an error: Object doesn't support this property or method: col.DecimalPlaces


 


So I got it to round to 4 decimal places with the following code:


             col.FormatType =  ftCurrency
             col.FormatString = "%.4m"


 


Thanks for your help Mike!
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 7/5/2025 4:48:23 AM