Simple Vb Script For Small Cents S’abonner

0
Avatar
Legacy Poster

Hi

 

Does anyone have a simple VB script to reduce the size of the font by 50% after a decimal point. I have a price (which is from a data source based on a csv file) and I want to make anything after the decimal to always be 50% of the font size relative to the price before the decimal. I am using Autosize for the font.

 

thanks.

5 commentaires

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

Hi.

I used "CurrencyExample 2.btw" and adapted it for my labels. It works but with limitations. The label printing is really slow (I'm talking minutes to print 1/2 dozen label records). I believe it may be because of the several data connections it is making to create the Price. Also the only option is to use superscript and subscript which is not very adaptable.

 

It would be better to have one VB script that will look at one data source that contains the "price" (example: 2.99) and convert it into $2.99 so that the dollar sign and the cents are formatted say 50% of the size of the Dollar value "2". I am using autosize for the font so that the font is resized smaller to fit larger amounts e.g. $123.99.

 

Is this possible?

thanks,

0
Avatar
Ian Cummings
Modérateur
Actions pour les commentaires Permalien

Perhaps you could attach you BarTender document, thus far, so I can see what you're doing...

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

I am creating a label that connects to a data source (xlsx file).

 

I need a vba script written that will look at one data source that contains the "price" (example a field containing 2.5 (Field("Sheet1$.SellPrice1") and covert it into $2.50 so that the dollar sign and the cents are formatted at say 50% (I may want to change this ratio) of the size of the Dollar value "2". I am using autosize for the font so that the font is resized to accommodate a larger price e.g. 123.99.

 

I have attached a bartender label file but I can't attach the source file as the uploader won't allow me to attach an xlsx or zip file.

 

thanks

0
Avatar
Ian Cummings
Modérateur
Actions pour les commentaires Permalien

How about you take a different approach.  Create two text objects that use the same data source (no VB script), then from the "Transforms" tab of each open the "Truncation" properties and choose to discard two characters from the right for the most significant value, and then keep two characters on the right for the least significant value.  Position, size, and align the two objects as is needed.

Vous devez vous connecter pour laisser un commentaire.