Skip to main content

Search

Search

VBscript to replace a "dot" decimal with a "comma" decimal

Comments

6 comments

  • Avatar
    Xabier Clemente
    Moderator

    Hello Bill,

    Thank you for reaching us via our Community Forums.

    Would it be possible to use the replace function for VB script in order to achieve this? I presume somewhere after the if condition you could add the following:

    str = Replace(str, ",", ".")

    I hope this helps!

    0
  • Avatar
    Bill Bridendall

    Thank you for your suggestion as Bartender Support did not suggest an alternative Bartender method to define the decimal and I thought it could be done with a VBscript but I'm not a programmer.

    0
  • Avatar
    Jose Adam Flores Sr.

    Hello Bill,

    I have noticed that your vbScript issue still not working,

    Although I'm not a full fledged programmer I do use a lot of vbScripts succesfuly

    if you could upload a copy of your BarTender format and a copy of your data Source (Maybe exported to a CSV

    in case your data is in a Database)

    I'll do my best to help you resolve your issue.

    Regards.

    Adam Flores Sr.

     

    0
  • Avatar
    Bill Bridendall

    Thank you for your offer, I'm currently trying to get in touch with other IT resources of the company I'm contracted with to stay within their security rules. I think it is a simple change and was able to test the concept with Excel using the standard REPLACE function. Might try to create separate entries and use the BT Suppress option to hide the one that doesn't apply......worked for Date formats. If that doesn't work will mock-up a simpler format with the current logic and put some data into a spreadsheet to use as a database to post online...no violation of company policy if I go that route.

    Regards,

    Bill Bridendall

    0
  • Avatar
    Peter Thane

    I don't think you need to use VB but can use Suppression instead. 

    • Add a 2nd identical template to you label but for the date set the type to Custom from the dropdown date options and type in the dd MM yy with commas in between instead of dots, ie dd.MM.yy
    • Go to the Properties of your original template and set the Print When to Conditionally based on expression and select your field in the database that includes the 34 and use the Does Not Equal parameter (I used select by data source in the image below as I used a Named field rather than a database object)
    • Repeat this process for the 2nd template but use the equals parameter

     


     

    0
  • Avatar
    Bill Bridendall

    Thanks for the guidance on the conditional Template options. I did something similar with Date formatting and was hoping to use that concept to revise weight data for different global regions which prefer to use the "dot" decimal or the "comma" decimal. We define formats by Customer "Ship-To" Site with a Regional setting, similar to Date formatting to meet their preference. I would very much prefer a solution that required no VB code as becomes harder to get future support given changing support personnel over the past 25 years. BT 2021/22 has greater flexibility to handle those changes and why I am trying to eliminate the 32-bit custom DLL we had been using for years with BT 9.4.

    Regards, Bill

     

    0

Please sign in to leave a comment.