import * as React from "react"; interface IValueLineComponentProps { label: string; value: number; color?: string; fractionDigits?: number; units?: string; } export class ValueLineComponent extends React.Component { constructor(props: IValueLineComponentProps) { super(props); } render() { const digits = this.props.fractionDigits !== undefined ? this.props.fractionDigits : 2; const value = this.props.value.toFixed(digits) + (this.props.units ? " " + this.props.units : ""); return (
{this.props.label}
{value}
); } }