Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
import type { ChartValue } from '@macro-inc/spreadsheet/sheet-drawings';
/** A cell a chart reads, with the Excel number format it displays with. */
export type CellChartValue = ChartValue & { format?: string };
export type ChartValues = (reference: string) => CellChartValue[] | undefined;
export function xml(value: string) {
return value
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
}
export const numberText = (value: number) =>
Number.isInteger(value)
? String(value)
: String(Number(value.toPrecision(15)));
/** The number format of the first number among values, as Excel caches it. */
export const numberFormat = (values: CellChartValue[] | undefined) =>
values?.find((value) => value.number !== undefined)?.format || 'General';