Re: [NTG-context] Metapost label - Truncating digits after decimal point

2009-12-15 Thread Aditya Mahajan
On Sat, 28 Nov 2009, Curiouslearn wrote: Hi, Is it possible to truncate the digits after decimal point in Metapost when using textext()? Please see the minimal example below which produces 1.84375. Can I just keep the first digit and have it produce 1.8 ? Thanks. If you are using mkiv, you

Re: [NTG-context] Metapost label - Truncating digits after decimal point

2009-12-15 Thread Curiouslearn
Thanks for this solution. Sounds small and clean. I need to learn Lua I guess. On Tue, Dec 15, 2009 at 5:34 AM, Aditya Mahajan adit...@umich.edu wrote: On Sat, 28 Nov 2009, Curiouslearn wrote: Hi, Is it possible to truncate the digits after decimal point in Metapost when using textext()?

Re: [NTG-context] Metapost label - Truncating digits after decimal point

2009-11-29 Thread Taco Hoekwater
Curiouslearn wrote: Hi, Is it possible to truncate the digits after decimal point in Metapost when using textext()? Please see the minimal example below which produces 1.84375. Can I just keep the first digit and have it produce 1.8 ? Here is a helper macro for you: def trunc_digits(expr n,

Re: [NTG-context] Metapost label - Truncating digits after decimal point

2009-11-29 Thread Curiouslearn
Thanks so much, Taco. I will try out the code below. Good to know that Metapost has functions such as substring. On Sun, Nov 29, 2009 at 3:32 AM, Taco Hoekwater t...@elvenkind.com wrote: Curiouslearn wrote: Hi, Is it possible to truncate the digits after decimal point in Metapost when