Skip to content

Custom string to bool conversion #818

@aeb-kb01

Description

@aeb-kb01

Is it possible to register a custom string to bool conversion?

[ExcelParameterConversion]
public static bool? StringToBool(string? value)
{
    value = value?.ToLowerInvariant();
    return value switch
    {
        "true" => true,
        _ => false,
    };
}

I tried above with bool? and string? (4 combinations) but all of them fail with #VALUE

The request may come weird but I am working on drop down support for intellisense and for bool types when user types TRUE exceltooltip window also pops up. I couldnt find a way to properly handle it and I think I shouldnt handle it so I was trying to fill the value as "TRUE" so exceltooltip wouldnt pop and tab completion etc would work better

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions