Stored procs and limiting decimal places

Results 1 to 2 of 2

Thread: Stored procs and limiting decimal places

  1. #1
    Join Date
    Dec 1969
    Posts
    16

    Default Stored procs and limiting decimal places

    I have a stored proc that is inserting an order from a shopping cart into a table - but the problem is that the tax portion of it is causing a problem with CyberCash due to having more than 2 decimal places after decimal point. The part of the stored proc that is causing the problem is:<BR><BR>SELECT @TaxAmt = @TaxTotal * .0775<BR><BR>I know with VBScript I can limit the number of decimal places:<BR><BR>&#060;%=FormatCurrency(sTaxTotal,2) %&#062;<BR><BR>Is the same thing possible in a stored proc?<BR><BR>Thanks for any suggestions.

  2. #2
    Jairo Guest

    Default RE: Stored procs and limiting decimal places

    Alan,<BR>Assuming you are using MS SQL Server, the convert function may suit your needs.<BR><BR>i.e. The value 100.055 will return 100.06.<BR>select convert(money, 100.055)<BR><BR>HTH,<BR>Jairo<BR>http://www.citywebarchitects.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •