import { Pipe, PipeTransform } from "@angular/core";

@Pipe({ name: "removeTrailingZero", standalone: true })
export class RemoveTrailingZeroPipe implements PipeTransform {
  transform(value: number): string {
    const roundedValue = Math.round(value * 100) / 100; // Round the number to two decimal places
    const stringValue = roundedValue.toString();
    return stringValue.endsWith(".00") ? stringValue.slice(0, -3) : stringValue;
  }
}
