Author Topic: MP3 Files' Metadata Formatted Output  (Read 142 times)

Darius1968

  • Hero Member
  • ***
  • Posts: 996
  • ---Darius
MP3 Files' Metadata Formatted Output
« on: June 20, 2022, 01:37:09 PM »
As far as my MP3 collection goes: 
{File.MD.photools.com::IMatch\30800\id3samplerate\0} Hz gets me an output like this: 
48000 Hz

But, how can I format the tag such that I will have an output like:
48 Khz or 44.1 Khz
« Last Edit: June 20, 2022, 01:53:33 PM by Darius1968 »

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 31554
Re: MP3 Files' Metadata Formatted Output
« Reply #1 on: June 20, 2022, 02:24:54 PM »
Simple math should do?

{File.MD.photools.com::IMatch\30800\id3samplerate\0|math:div,1000} Khz

Darius1968

  • Hero Member
  • ***
  • Posts: 996
  • ---Darius
Re: MP3 Files' Metadata Formatted Output
« Reply #2 on: June 20, 2022, 04:22:45 PM »
I used {File.MD.photools.com::IMatch\30800\id3samplerate\0|math:div,1000,1} Khz
...Which works perfectly for MP3s with a 44.1 Khz sampling rate.  With MP3s having 48 Khz, however, the XAML output defaults to 48.0 Khz
So, how can I further refine the expression to suppress the display of .0, for cases in which the value is just an exact multiple of 1,000? 

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 31554
Re: MP3 Files' Metadata Formatted Output
« Reply #3 on: June 20, 2022, 04:33:18 PM »
You demand one decimal digit by specifying ,1 so you get it.
There is no "one decimal digit except it is 0 or it is rounded to .1" or something.
Use replace to trim the .0 or use two formulas for either case.